From 897af7ce56205f3790b21704176af28338109bd6 Mon Sep 17 00:00:00 2001 From: Semi212 <2729735763@qq.com> Date: Sat, 7 May 2022 16:25:11 +0800 Subject: [PATCH] Panoramic --- .idea/vcs.xml | 0 Dcl/transforms/functional.py | 0 DetectFineSortVideo.py | 11 +- Font/msyh.ttc | Bin Font/msyhbd.ttc | Bin Font/msyhl.ttc | Bin Font/simsun.ttc | Bin GetFineDatasetNoLabel.py | 0 Hatcher_cam.py | 0 Hatcher_red.py | 0 SemiLogo.py | 0 System_I.py | 2 +- Y5/data/argoverse_hd.yaml | 0 Y5/data/coco.yaml | 0 Y5/data/coco128.yaml | 0 Y5/data/hyp.finetune.yaml | 0 Y5/data/hyp.scratch.yaml | 0 Y5/data/images/bus.jpg | Bin Y5/data/images/zidane.jpg | Bin Y5/data/scripts/get_argoverse_hd.sh | 0 Y5/data/voc.yaml | 0 Y5/models/__init__.py | 0 Y5/models/common.py | 0 Y5/models/experimental.py | 0 Y5/models/export.py | 0 Y5/models/hub/anchors.yaml | 0 Y5/models/hub/yolov3-spp.yaml | 0 Y5/models/hub/yolov3-tiny.yaml | 0 Y5/models/hub/yolov3.yaml | 0 Y5/models/hub/yolov5-fpn.yaml | 0 Y5/models/hub/yolov5-p2.yaml | 0 Y5/models/hub/yolov5-p6.yaml | 0 Y5/models/hub/yolov5-p7.yaml | 0 Y5/models/hub/yolov5-panet.yaml | 0 Y5/models/hub/yolov5l6.yaml | 0 Y5/models/hub/yolov5m6.yaml | 0 Y5/models/hub/yolov5s6.yaml | 0 Y5/models/hub/yolov5x6.yaml | 0 Y5/models/yolo.py | 0 Y5/models/yolov5l.yaml | 0 Y5/models/yolov5m.yaml | 0 Y5/models/yolov5s.yaml | 0 Y5/models/yolov5x.yaml | 0 Y5/utils/__init__.py | 0 Y5/utils/activations.py | 0 Y5/utils/autoanchor.py | 0 Y5/utils/aws/__init__.py | 0 Y5/utils/aws/mime.sh | 0 Y5/utils/aws/resume.py | 0 Y5/utils/aws/userdata.sh | 0 Y5/utils/google_app_engine/Dockerfile | 0 .../additional_requirements.txt | 0 Y5/utils/google_app_engine/app.yaml | 0 Y5/utils/google_utils.py | 0 Y5/utils/loss.py | 0 Y5/utils/metrics.py | 0 Y5/utils/plots.py | 0 Y5/utils/torch_utils.py | 0 Y5/utils/wandb_logging/__init__.py | 0 Y5/utils/wandb_logging/log_dataset.py | 0 Y5/utils/wandb_logging/wandb_utils.py | 0 cal_fileNum.py | 0 check_info.py | 0 common.py | 20 ++- con_time_cut.py | 0 creat_xml.py | 0 creat_xml_fordetection.py | 0 cv2AddChineseText.py | 0 detection_negative_samples.py | 0 fine/config.py | 0 fine/fineConfig.py | 0 fine/models/LoadModel.py | 0 fine/transforms/__init__.py | 0 fine/transforms/functional.py | 0 fine/transforms/transforms.py | 0 fine/util/Asoftmax_loss.py | 0 fine/util/__init__.py | 0 fine/util/autoaugment.py | 0 fine/util/dataset_DCL.py | 0 fine/util/eval_model.py | 0 fine/util/test_tool.py | 0 fine/util/train_model.py | 0 fine/util/utils.py | 0 get_fine_dataset.py | 170 +++++++----------- globalvar.py | 0 gyd.py | 0 gyd_r.py | 0 jpg.py | 0 logo.png | Bin network.py | 0 network_multi.py | 0 num.txt | 0 requirements.txt | 0 rtsp_process.py | 0 setup.py | 0 sort/.gitignore | 0 sort/LICENSE | 0 sort/README.md | 0 sort/data/train/ADL-Rundle-6/det/det.txt | 0 sort/data/train/ADL-Rundle-8/det/det.txt | 0 sort/data/train/ETH-Bahnhof/det/det.txt | 0 sort/data/train/ETH-Pedcross2/det/det.txt | 0 sort/data/train/ETH-Sunnyday/det/det.txt | 0 sort/data/train/KITTI-13/det/det.txt | 0 sort/data/train/KITTI-17/det/det.txt | 0 sort/data/train/PETS09-S2L1/det/det.txt | 0 sort/data/train/TUD-Campus/det/det.txt | 0 sort/data/train/TUD-Stadtmitte/det/det.txt | 0 sort/data/train/Venice-2/det/det.txt | 0 sort/requirements.txt | 0 sort/sort.py | 0 video_con.py | 0 video_execfile.py | 0 video_notice.py | 0 visual_xml_result.py | 0 web_showjson.py | 0 yolo_detector.py | 0 117 files changed, 79 insertions(+), 124 deletions(-) mode change 100644 => 100755 .idea/vcs.xml mode change 100644 => 100755 Dcl/transforms/functional.py mode change 100644 => 100755 DetectFineSortVideo.py mode change 100644 => 100755 Font/msyh.ttc mode change 100644 => 100755 Font/msyhbd.ttc mode change 100644 => 100755 Font/msyhl.ttc mode change 100644 => 100755 Font/simsun.ttc mode change 100644 => 100755 GetFineDatasetNoLabel.py mode change 100644 => 100755 Hatcher_cam.py mode change 100644 => 100755 Hatcher_red.py mode change 100644 => 100755 SemiLogo.py mode change 100644 => 100755 Y5/data/argoverse_hd.yaml mode change 100644 => 100755 Y5/data/coco.yaml mode change 100644 => 100755 Y5/data/coco128.yaml mode change 100644 => 100755 Y5/data/hyp.finetune.yaml mode change 100644 => 100755 Y5/data/hyp.scratch.yaml mode change 100644 => 100755 Y5/data/images/bus.jpg mode change 100644 => 100755 Y5/data/images/zidane.jpg mode change 100644 => 100755 Y5/data/scripts/get_argoverse_hd.sh mode change 100644 => 100755 Y5/data/voc.yaml mode change 100644 => 100755 Y5/models/__init__.py mode change 100644 => 100755 Y5/models/common.py mode change 100644 => 100755 Y5/models/experimental.py mode change 100644 => 100755 Y5/models/export.py mode change 100644 => 100755 Y5/models/hub/anchors.yaml mode change 100644 => 100755 Y5/models/hub/yolov3-spp.yaml mode change 100644 => 100755 Y5/models/hub/yolov3-tiny.yaml mode change 100644 => 100755 Y5/models/hub/yolov3.yaml mode change 100644 => 100755 Y5/models/hub/yolov5-fpn.yaml mode change 100644 => 100755 Y5/models/hub/yolov5-p2.yaml mode change 100644 => 100755 Y5/models/hub/yolov5-p6.yaml mode change 100644 => 100755 Y5/models/hub/yolov5-p7.yaml mode change 100644 => 100755 Y5/models/hub/yolov5-panet.yaml mode change 100644 => 100755 Y5/models/hub/yolov5l6.yaml mode change 100644 => 100755 Y5/models/hub/yolov5m6.yaml mode change 100644 => 100755 Y5/models/hub/yolov5s6.yaml mode change 100644 => 100755 Y5/models/hub/yolov5x6.yaml mode change 100644 => 100755 Y5/models/yolo.py mode change 100644 => 100755 Y5/models/yolov5l.yaml mode change 100644 => 100755 Y5/models/yolov5m.yaml mode change 100644 => 100755 Y5/models/yolov5s.yaml mode change 100644 => 100755 Y5/models/yolov5x.yaml mode change 100644 => 100755 Y5/utils/__init__.py mode change 100644 => 100755 Y5/utils/activations.py mode change 100644 => 100755 Y5/utils/autoanchor.py mode change 100644 => 100755 Y5/utils/aws/__init__.py mode change 100644 => 100755 Y5/utils/aws/mime.sh mode change 100644 => 100755 Y5/utils/aws/resume.py mode change 100644 => 100755 Y5/utils/aws/userdata.sh mode change 100644 => 100755 Y5/utils/google_app_engine/Dockerfile mode change 100644 => 100755 Y5/utils/google_app_engine/additional_requirements.txt mode change 100644 => 100755 Y5/utils/google_app_engine/app.yaml mode change 100644 => 100755 Y5/utils/google_utils.py mode change 100644 => 100755 Y5/utils/loss.py mode change 100644 => 100755 Y5/utils/metrics.py mode change 100644 => 100755 Y5/utils/plots.py mode change 100644 => 100755 Y5/utils/torch_utils.py mode change 100644 => 100755 Y5/utils/wandb_logging/__init__.py mode change 100644 => 100755 Y5/utils/wandb_logging/log_dataset.py mode change 100644 => 100755 Y5/utils/wandb_logging/wandb_utils.py mode change 100644 => 100755 cal_fileNum.py mode change 100644 => 100755 check_info.py mode change 100644 => 100755 common.py mode change 100644 => 100755 con_time_cut.py mode change 100644 => 100755 creat_xml.py mode change 100644 => 100755 creat_xml_fordetection.py mode change 100644 => 100755 cv2AddChineseText.py mode change 100644 => 100755 detection_negative_samples.py mode change 100644 => 100755 fine/config.py mode change 100644 => 100755 fine/fineConfig.py mode change 100644 => 100755 fine/models/LoadModel.py mode change 100644 => 100755 fine/transforms/__init__.py mode change 100644 => 100755 fine/transforms/functional.py mode change 100644 => 100755 fine/transforms/transforms.py mode change 100644 => 100755 fine/util/Asoftmax_loss.py mode change 100644 => 100755 fine/util/__init__.py mode change 100644 => 100755 fine/util/autoaugment.py mode change 100644 => 100755 fine/util/dataset_DCL.py mode change 100644 => 100755 fine/util/eval_model.py mode change 100644 => 100755 fine/util/test_tool.py mode change 100644 => 100755 fine/util/train_model.py mode change 100644 => 100755 fine/util/utils.py mode change 100644 => 100755 globalvar.py mode change 100644 => 100755 gyd.py mode change 100644 => 100755 gyd_r.py mode change 100644 => 100755 jpg.py mode change 100644 => 100755 logo.png mode change 100644 => 100755 network.py mode change 100644 => 100755 network_multi.py mode change 100644 => 100755 num.txt mode change 100644 => 100755 requirements.txt mode change 100644 => 100755 rtsp_process.py mode change 100644 => 100755 setup.py mode change 100644 => 100755 sort/.gitignore mode change 100644 => 100755 sort/LICENSE mode change 100644 => 100755 sort/README.md mode change 100644 => 100755 sort/data/train/ADL-Rundle-6/det/det.txt mode change 100644 => 100755 sort/data/train/ADL-Rundle-8/det/det.txt mode change 100644 => 100755 sort/data/train/ETH-Bahnhof/det/det.txt mode change 100644 => 100755 sort/data/train/ETH-Pedcross2/det/det.txt mode change 100644 => 100755 sort/data/train/ETH-Sunnyday/det/det.txt mode change 100644 => 100755 sort/data/train/KITTI-13/det/det.txt mode change 100644 => 100755 sort/data/train/KITTI-17/det/det.txt mode change 100644 => 100755 sort/data/train/PETS09-S2L1/det/det.txt mode change 100644 => 100755 sort/data/train/TUD-Campus/det/det.txt mode change 100644 => 100755 sort/data/train/TUD-Stadtmitte/det/det.txt mode change 100644 => 100755 sort/data/train/Venice-2/det/det.txt mode change 100644 => 100755 sort/requirements.txt mode change 100644 => 100755 sort/sort.py mode change 100644 => 100755 video_con.py mode change 100644 => 100755 video_execfile.py mode change 100644 => 100755 video_notice.py mode change 100644 => 100755 visual_xml_result.py mode change 100644 => 100755 web_showjson.py mode change 100644 => 100755 yolo_detector.py diff --git a/.idea/vcs.xml b/.idea/vcs.xml old mode 100644 new mode 100755 diff --git a/Dcl/transforms/functional.py b/Dcl/transforms/functional.py old mode 100644 new mode 100755 diff --git a/DetectFineSortVideo.py b/DetectFineSortVideo.py old mode 100644 new mode 100755 index c731f61..2164e33 --- a/DetectFineSortVideo.py +++ b/DetectFineSortVideo.py @@ -57,10 +57,12 @@ class DetFineVid(): if frame.shape[1] == 3840: gp.fontScale = 3 elif frame.shape[1] == 2560: - gp.fontScale = 2 + gp.fontScale = 1 else: gp.fontScale = 1 - + for i in range(20): + res, frame = cap.read() + print("skip{}".format(i)) num_image = 0 while True: @@ -129,6 +131,7 @@ class DetFineVid(): def commanddeal(): SavePath = "/data1/Hatcher/model/project/data_MPKFNet/result/" + print("starting ",gp.VideoPath) DFS = DetFineVid(gp.VideoPath,SavePath) DFS.StartRec() DFS.conVideo() @@ -261,8 +264,8 @@ def globalInit(): #deal all file in a folder if __name__ == '__main__': multiprocessing.set_start_method("spawn") rootPath = "/data/DataManagement/Project/005_kunmingdianchi/0002_20220412_800_200/研究院-鱼视频/" - filedeal(rootPath) - #commanddeal() + #filedeal(rootPath) + commanddeal() diff --git a/Font/msyh.ttc b/Font/msyh.ttc old mode 100644 new mode 100755 diff --git a/Font/msyhbd.ttc b/Font/msyhbd.ttc old mode 100644 new mode 100755 diff --git a/Font/msyhl.ttc b/Font/msyhl.ttc old mode 100644 new mode 100755 diff --git a/Font/simsun.ttc b/Font/simsun.ttc old mode 100644 new mode 100755 diff --git a/GetFineDatasetNoLabel.py b/GetFineDatasetNoLabel.py old mode 100644 new mode 100755 diff --git a/Hatcher_cam.py b/Hatcher_cam.py old mode 100644 new mode 100755 diff --git a/Hatcher_red.py b/Hatcher_red.py old mode 100644 new mode 100755 diff --git a/SemiLogo.py b/SemiLogo.py old mode 100644 new mode 100755 diff --git a/System_I.py b/System_I.py index 57b4cf6..db2057f 100755 --- a/System_I.py +++ b/System_I.py @@ -1429,7 +1429,7 @@ class RealDeal(): tprint4 = time.time() if gp.DebugPrint_flag: print("tprint3 is ", (tprint4 - tprint3) * 1000) - draw = plot_one_box(xyxy, draw, height_or,width_or,label=label, Index=index,color=colors, line_thickness=int(3*gp.radioShowtext)) + draw = plot_one_box(xyxy, draw, height_or,width_or,label=label, Index=index,color=colors, line_thickness=int(1.5*gp.radioShowtext)) tpChin1 = time.time() if num_image > gp.showThresh : gp.num_count_old = len(boxes_fine) diff --git a/Y5/data/argoverse_hd.yaml b/Y5/data/argoverse_hd.yaml old mode 100644 new mode 100755 diff --git a/Y5/data/coco.yaml b/Y5/data/coco.yaml old mode 100644 new mode 100755 diff --git a/Y5/data/coco128.yaml b/Y5/data/coco128.yaml old mode 100644 new mode 100755 diff --git a/Y5/data/hyp.finetune.yaml b/Y5/data/hyp.finetune.yaml old mode 100644 new mode 100755 diff --git a/Y5/data/hyp.scratch.yaml b/Y5/data/hyp.scratch.yaml old mode 100644 new mode 100755 diff --git a/Y5/data/images/bus.jpg b/Y5/data/images/bus.jpg old mode 100644 new mode 100755 diff --git a/Y5/data/images/zidane.jpg b/Y5/data/images/zidane.jpg old mode 100644 new mode 100755 diff --git a/Y5/data/scripts/get_argoverse_hd.sh b/Y5/data/scripts/get_argoverse_hd.sh old mode 100644 new mode 100755 diff --git a/Y5/data/voc.yaml b/Y5/data/voc.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/__init__.py b/Y5/models/__init__.py old mode 100644 new mode 100755 diff --git a/Y5/models/common.py b/Y5/models/common.py old mode 100644 new mode 100755 diff --git a/Y5/models/experimental.py b/Y5/models/experimental.py old mode 100644 new mode 100755 diff --git a/Y5/models/export.py b/Y5/models/export.py old mode 100644 new mode 100755 diff --git a/Y5/models/hub/anchors.yaml b/Y5/models/hub/anchors.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/hub/yolov3-spp.yaml b/Y5/models/hub/yolov3-spp.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/hub/yolov3-tiny.yaml b/Y5/models/hub/yolov3-tiny.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/hub/yolov3.yaml b/Y5/models/hub/yolov3.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/hub/yolov5-fpn.yaml b/Y5/models/hub/yolov5-fpn.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/hub/yolov5-p2.yaml b/Y5/models/hub/yolov5-p2.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/hub/yolov5-p6.yaml b/Y5/models/hub/yolov5-p6.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/hub/yolov5-p7.yaml b/Y5/models/hub/yolov5-p7.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/hub/yolov5-panet.yaml b/Y5/models/hub/yolov5-panet.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/hub/yolov5l6.yaml b/Y5/models/hub/yolov5l6.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/hub/yolov5m6.yaml b/Y5/models/hub/yolov5m6.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/hub/yolov5s6.yaml b/Y5/models/hub/yolov5s6.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/hub/yolov5x6.yaml b/Y5/models/hub/yolov5x6.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/yolo.py b/Y5/models/yolo.py old mode 100644 new mode 100755 diff --git a/Y5/models/yolov5l.yaml b/Y5/models/yolov5l.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/yolov5m.yaml b/Y5/models/yolov5m.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/yolov5s.yaml b/Y5/models/yolov5s.yaml old mode 100644 new mode 100755 diff --git a/Y5/models/yolov5x.yaml b/Y5/models/yolov5x.yaml old mode 100644 new mode 100755 diff --git a/Y5/utils/__init__.py b/Y5/utils/__init__.py old mode 100644 new mode 100755 diff --git a/Y5/utils/activations.py b/Y5/utils/activations.py old mode 100644 new mode 100755 diff --git a/Y5/utils/autoanchor.py b/Y5/utils/autoanchor.py old mode 100644 new mode 100755 diff --git a/Y5/utils/aws/__init__.py b/Y5/utils/aws/__init__.py old mode 100644 new mode 100755 diff --git a/Y5/utils/aws/mime.sh b/Y5/utils/aws/mime.sh old mode 100644 new mode 100755 diff --git a/Y5/utils/aws/resume.py b/Y5/utils/aws/resume.py old mode 100644 new mode 100755 diff --git a/Y5/utils/aws/userdata.sh b/Y5/utils/aws/userdata.sh old mode 100644 new mode 100755 diff --git a/Y5/utils/google_app_engine/Dockerfile b/Y5/utils/google_app_engine/Dockerfile old mode 100644 new mode 100755 diff --git a/Y5/utils/google_app_engine/additional_requirements.txt b/Y5/utils/google_app_engine/additional_requirements.txt old mode 100644 new mode 100755 diff --git a/Y5/utils/google_app_engine/app.yaml b/Y5/utils/google_app_engine/app.yaml old mode 100644 new mode 100755 diff --git a/Y5/utils/google_utils.py b/Y5/utils/google_utils.py old mode 100644 new mode 100755 diff --git a/Y5/utils/loss.py b/Y5/utils/loss.py old mode 100644 new mode 100755 diff --git a/Y5/utils/metrics.py b/Y5/utils/metrics.py old mode 100644 new mode 100755 diff --git a/Y5/utils/plots.py b/Y5/utils/plots.py old mode 100644 new mode 100755 diff --git a/Y5/utils/torch_utils.py b/Y5/utils/torch_utils.py old mode 100644 new mode 100755 diff --git a/Y5/utils/wandb_logging/__init__.py b/Y5/utils/wandb_logging/__init__.py old mode 100644 new mode 100755 diff --git a/Y5/utils/wandb_logging/log_dataset.py b/Y5/utils/wandb_logging/log_dataset.py old mode 100644 new mode 100755 diff --git a/Y5/utils/wandb_logging/wandb_utils.py b/Y5/utils/wandb_logging/wandb_utils.py old mode 100644 new mode 100755 diff --git a/cal_fileNum.py b/cal_fileNum.py old mode 100644 new mode 100755 diff --git a/check_info.py b/check_info.py old mode 100644 new mode 100755 diff --git a/common.py b/common.py old mode 100644 new mode 100755 index 27dc05f..f7f4140 --- a/common.py +++ b/common.py @@ -8,9 +8,9 @@ import os,torch, threading,argparse class global_para(): #check() parser1 = argparse.ArgumentParser(description="CUI") - parser1.add_argument("--video_num", default='/data1/Hatcher/model/project/data_MPKFNet/rawdata/PYH-DEMO.mp4', type=str, + parser1.add_argument("video_num", default='/data1/Hatcher/model/project/data_MPKFNet/rawdata/竹林嘴-3月3日候鸟视频.mp4', type=str, help='Video name.') - parser1.add_argument("--GPU", default='6', type=str, + parser1.add_argument("GPU", default='2', type=str, help='GPU.') parser1.add_argument("--thresh", default=0.4, type=float, help='GPU.') @@ -79,13 +79,13 @@ class global_para(): Fine_thresh = 0.4 # DetWeight = "/data1/Hatcher/model/Detection/yolov5/runs/train/exp21/weights/best.pt" - # FineWeight = "/data/Hatcher/data/weigth/areaproject/resnet50-PYH-3-20.7/_42522_PYH-3/best.pth" + # FineWeight = "/data/Hatcher/data/weigth/areaproject/resnet50-JXPYH-Bird-3-4-20220429/_42911_PYH-3/best.pth" DetWeight = "/data1/Hatcher/model/Detection/yolov5/runs/train/KunMingCuiHu-Fish2/weights/best.pt" - FineWeight = "/data/Hatcher/data/weigth/areaproject/resnet50-DianChiFish-3-3-0.7/_4289_DianChiFish-4/best.pth" + FineWeight = "/data/Hatcher/data/weigth/areaproject/resnet50-KMDC-Fish-5-1-20220505/_5510_DianChiFish-4/best.pth" # DetWeight = "/data1/Hatcher/model/Detection/yolov5/runs/train/BeijingCuiHu-Bird26/weights/best.pt" # FineWeight = "/data/Hatcher/data/weigth/areaproject/resnet50-cui90_1model0.7/_42111_CUI-94-1/best.pth" - # BHG_chineseName = ["kong", '白鹤', '白头鹤','白枕鹤']#["kong","鲫鱼","麦穗鱼","鳑鲏"] - BHG_chineseName = ["kong","鲫鱼","麦穗鱼","鳑鲏"] + #BHG_chineseName = ["kong", '白鹤', '白头鹤','白枕鹤'] + BHG_chineseName = ["kong","鲫鱼","麦穗鱼","鳑鲏","鲈鱼"] # BHG_chineseName = ['Kong', '白额雁', '白骨顶', '苍鹭', '苍鹭', '白秋沙鸭', '白腰草鹬', '斑头雁', '斑嘴鸭', '苍鹭', '赤膀鸭', '赤颈鸭', '苍鹭', '大麻鳽', # '豆雁', '反嘴鹬', '凤头鸊鷉', '凤头麦鸡', '凤头潜鸭', '黑鹳', '黑水鸡', '红嘴鸥', '鸿雁', '灰鹤', '灰雁', '绿翅鸭', '绿头鸭', '琵嘴鸭', @@ -96,12 +96,13 @@ class global_para(): # '白鹈鹕', '红头潜鸭', '苍鹰', '蒙古银鸥', '西方秧鸡', '赤嘴潜鸭', '阔嘴鹬', '雕鸮', '鹌鹑', '鹗', '黄苇鳽', '黑颈鹤', '小䴙䴘', '赤麻鸭'] # BHG_chineseName =["kong","绿头鸭","斑嘴鸭","灰雁","鸿雁","kong","小鷿鷈"] spiec_number_old = [0 for i in range(len(BHG_chineseName))] - FineClassNum = 4 + FineClassNum = 5 color_show = (255, 255, 255) color_box = (255, 0, 0) - NoneLabel = "鱼" # "鹤类" + NoneLabel = "鱼"#"鹤类" # "鱼" fine_thresh1 = 6000 - fine_thresh2 = 10000 + fine_thresh2 = 6000 + ShowAllNumFlag = True fontScale = 1 """ 1.change weight @@ -113,6 +114,7 @@ class global_para(): 7. change main 8. change fine_thresh2 9. GPU +10. change ShowAllNumFlag fontScale plot file para to adjust chinese 400W ---2 200W ---1 800W ---3 diff --git a/con_time_cut.py b/con_time_cut.py old mode 100644 new mode 100755 diff --git a/creat_xml.py b/creat_xml.py old mode 100644 new mode 100755 diff --git a/creat_xml_fordetection.py b/creat_xml_fordetection.py old mode 100644 new mode 100755 diff --git a/cv2AddChineseText.py b/cv2AddChineseText.py old mode 100644 new mode 100755 diff --git a/detection_negative_samples.py b/detection_negative_samples.py old mode 100644 new mode 100755 diff --git a/fine/config.py b/fine/config.py old mode 100644 new mode 100755 diff --git a/fine/fineConfig.py b/fine/fineConfig.py old mode 100644 new mode 100755 diff --git a/fine/models/LoadModel.py b/fine/models/LoadModel.py old mode 100644 new mode 100755 diff --git a/fine/transforms/__init__.py b/fine/transforms/__init__.py old mode 100644 new mode 100755 diff --git a/fine/transforms/functional.py b/fine/transforms/functional.py old mode 100644 new mode 100755 diff --git a/fine/transforms/transforms.py b/fine/transforms/transforms.py old mode 100644 new mode 100755 diff --git a/fine/util/Asoftmax_loss.py b/fine/util/Asoftmax_loss.py old mode 100644 new mode 100755 diff --git a/fine/util/__init__.py b/fine/util/__init__.py old mode 100644 new mode 100755 diff --git a/fine/util/autoaugment.py b/fine/util/autoaugment.py old mode 100644 new mode 100755 diff --git a/fine/util/dataset_DCL.py b/fine/util/dataset_DCL.py old mode 100644 new mode 100755 diff --git a/fine/util/eval_model.py b/fine/util/eval_model.py old mode 100644 new mode 100755 diff --git a/fine/util/test_tool.py b/fine/util/test_tool.py old mode 100644 new mode 100755 diff --git a/fine/util/train_model.py b/fine/util/train_model.py old mode 100644 new mode 100755 diff --git a/fine/util/utils.py b/fine/util/utils.py old mode 100644 new mode 100755 diff --git a/get_fine_dataset.py b/get_fine_dataset.py index b5e3c99..adfe9a8 100755 --- a/get_fine_dataset.py +++ b/get_fine_dataset.py @@ -2,15 +2,12 @@ import xml.dom.minidom from tqdm import tqdm from glob import glob import cv2 -import os -from PIL import Image +import os,argparse import numpy as np from jpg import jpg -txt_root_path = "/data/DataManagement/Project/005_kunmingdianchi/0002_20220412_800_200/Dataset/VOC0050201" #xml_files = glob('./temp2/*.xml') -image_T = 50 -num_count = 0 -root_path = "/data/DataManagement/Project/005_kunmingdianchi/0002_20220412_800_200/Dataset/VOC0050201/Annotations/" + +class_name = ["Anser albifrons" ,"Fulica atra" ,"Leucogeranus leucogeranus" ,"Egretta garzetta","Platalea leucorodia" ,"Mergellus albellus" ,"Grus monacha" ,"Tringa ochropus" ,"Numenius arquata" ,"Anser indicus","Anas zonorhyncha","Ardea cinerea","Mareca strepera" ,"Mareca penelope" ,"Tadorna ferruginea","Ardea alba","Numenius madagascariensis" ,"Botaurus stellaris" ,"Ciconia boyciana" ,"Anser fabalis" ,"Recurvirostra avosetta" ,"Podiceps cristatus","Vanellus vanellus" ,"Aythya fuligula" ,"Tringa erythropus","Calidris alpina" ,"Ciconia nigra" ,"Gallinula chloropus","Porphyrio poliocephalus","Larus ridibundus" ,"Anser cygnoides" ,"Charadrius alexandrinusw" ,"Pluvialis squatarola" ,"Grus grus" ,"Anser anser" ,"Pluvialis fulva" ,"Charadrius dubius" ,"Anas crecca","Anas platyrhynchos","Spatula clypeata","Phalacrocorax carbo","Mergus merganser" ,"Tadorna tadorna" ,"Tringa nebulariaw","Bucephala clangula" ,"Gallinago gallinago" ,"Anser erythropus","Cygnus columbianus" ,"Ichthyaetus ichthyaetus","Anas acuta" ,"Ardea intermedia"] def cv2_crop(im, box): '''cv2实现类似PIL的裁剪 @@ -32,111 +29,64 @@ def convert(size, box): h = h*dh return (x,y,w,h) -# for xml_path in os.listdir(root_path): -# xml_files = glob(os.path.join(root_path,xml_path,"*.xml")) -# print(os.path.join(root_path.replace("xml","image"),xml_path)) -# jpg(os.path.join(root_path.replace("xml","image"),xml_path)) -# f = open("./Hatcher_ALL.txt", "a") -# txt_lists = [] -# for xml_file in tqdm(xml_files): -# -# print(xml_file+" is doing") -# DOMTree = xml.dom.minidom.parse(xml_file) -# collection = DOMTree.documentElement -# #img_name = collection.getElementsByTagName("filename")[0].childNodes[0].data -# img_name = xml_file.replace("\\xml\\","\\image\\").replace(".xml",".jpg") -# objects = collection.getElementsByTagName("object") -# #img = cv2.imread(img_name) -# img = cv2.imdecode(np.fromfile(img_name,dtype=np.uint8),-1) -# #cv2.imwrite(img_name,img) -# #img = cv2.imdecode(np.fromfile(img_name,dtype=np.uint8),-1) -# # im = Image.open(img_name) -# # im.save(img_name, quality=100) -# # im = Image.open(img_name) -# for object_id in objects: -# xmin = object_id.getElementsByTagName('bndbox')[0].getElementsByTagName('xmin')[0].childNodes[0].data -# ymin = object_id.getElementsByTagName('bndbox')[0].getElementsByTagName('ymin')[0].childNodes[0].data -# xmax = object_id.getElementsByTagName('bndbox')[0].getElementsByTagName('xmax')[0].childNodes[0].data -# ymax = object_id.getElementsByTagName('bndbox')[0].getElementsByTagName('ymax')[0].childNodes[0].data -# name = object_id.getElementsByTagName('name')[0].childNodes[0].data -# xmin = int(xmin) -# xmax = int(xmax) -# ymin = int(ymin) -# ymax = int(ymax) -# class_index = class_name.index(str(name).replace("\t","").strip()) -# img1 = cv2_crop(img,(xmin, ymin,xmax, ymax)) -# cv2.imwrite("H:\\Fine-grained-identification\\2021.3.25\Hatcher_One\\" + str(name).replace("\t","").strip().replace(" ","_" )+"_{}.jpg".format(num_count), img1) -# txt_lists.append(str(name).replace("\t","").strip().replace(" ","_" )+"_{}.jpg".format(num_count)+" "+str(class_index)+'\n') -# #f.write(str(name).replace("\t","").strip().replace(" ","_" )+"_{}.jpg".format(num_count)+" "+str(class_index)+'\n') -# num_count += 1 -# for txt_list in txt_lists: -# f.write(txt_list) -# f.close() -# f_num = open("./num.txt", "w") -# f_num.write(str(num_count)) -# f_num.close() -# print(num_count) -# for xml_file in tqdm(xml_files): -# os.remove(xml_file) -# -# #os.remove(xml_file) -# print(num_count) +def VocToFineWithLabel(num_count,root_path,image_T): + xml_files = glob(os.path.join(root_path,"*.xml")) + jpg(os.path.join(root_path.replace("Annotations","JPEGImages"))) + txt_lists = [] + for xml_file in tqdm(xml_files): -xml_files = glob(os.path.join(root_path,"*.xml")) -#print(os.path.join(root_path.replace("Annotations","JPEGImages"))) -jpg(os.path.join(root_path.replace("Annotations","JPEGImages"))) -f = open(txt_root_path+"/Hatcher_ALL.txt", "a") -txt_lists = [] -for xml_file in tqdm(xml_files): + #print(xml_file+" is doing") + DOMTree = xml.dom.minidom.parse(xml_file) + collection = DOMTree.documentElement + #img_name = collection.getElementsByTagName("filename")[0].childNodes[0].data + img_name = xml_file.replace("Annotations","JPEGImages").replace(".xml",".jpg") + objects = collection.getElementsByTagName("object") + #img = cv2.imread(img_name) + img = cv2.imdecode(np.fromfile(img_name,dtype=np.uint8),-1) + #cv2.imwrite(img_name,img) + #img = cv2.imdecode(np.fromfile(img_name,dtype=np.uint8),-1) + # im = Image.open(img_name) + # im.save(img_name, quality=100) + # im = Image.open(img_name) + for object_id in objects: + xmin = object_id.getElementsByTagName('bndbox')[0].getElementsByTagName('xmin')[0].childNodes[0].data + ymin = object_id.getElementsByTagName('bndbox')[0].getElementsByTagName('ymin')[0].childNodes[0].data + xmax = object_id.getElementsByTagName('bndbox')[0].getElementsByTagName('xmax')[0].childNodes[0].data + ymax = object_id.getElementsByTagName('bndbox')[0].getElementsByTagName('ymax')[0].childNodes[0].data + name = object_id.getElementsByTagName('name')[0].childNodes[0].data + ratio_x = (3840.0/3840.0) + ratio_y = (2160.0/2160.0) + #print(ratio_x," ",ratio_y) + #print(type(xmin)) + #exit() + xmin = int(float(xmin)*ratio_x) + xmax = int(float(xmax)*ratio_x) + ymin = int(float(ymin)*ratio_y) + ymax = int(float(ymax)*ratio_y) + if ((xmax - xmin)