算法库
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .gitattributes+4
- 3_基于视觉的无人艇感知技术/.gitkeepAdded
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/.gitkeepAdded
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/.idea/.gitignoreAdded
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/.idea/inspectionProfiles/profiles_settings.xmlAdded+6
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/.idea/misc.xmlAdded+7
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/.idea/modules.xmlAdded+8
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/.idea/workspace.xmlAdded+204
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/.idea/yolov4_pytorch_down_1fpn.imlAdded+12
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/2007_test.txtAdded+278
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/2007_train.txtAdded
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/2007_val.txtAdded
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/FPS_test.pyAdded+119
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/LICENSEAdded+21
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/README.mdAdded+137
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/VOCdevkit/VOC2007/ImageSets/Main/README.mdAdded+1
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/VOCdevkit/VOC2007/ImageSets/Main/test.txtAdded+278
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/VOCdevkit/VOC2007/ImageSets/Main/train.txtAdded+1178
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/VOCdevkit/VOC2007/ImageSets/Main/trainval.txtAdded
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/VOCdevkit/VOC2007/ImageSets/Main/val.txtAdded
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/VOCdevkit/VOC2007/voc2yolo4.pyAdded+61
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/__pycache__/yolo.cpython-36.pycAdded
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/get_dr_txt.pyAdded+144
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/get_gt_txt.pyAdded+63
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/get_map.pyAdded+901
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/get_sizemap.pyAdded+407
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/img/street.jpgAdded
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/kmeans_for_anchors.pyAdded+111
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/model_data/coco_classes.txtAdded+80
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/model_data/voc_classes.txtAdded+9
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/model_data/yolo_anchors.txtAdded+1
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/nets/CSPdarknet.pyAdded+179
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/nets/__pycache__/CSPdarknet.cpython-36.pycAdded
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/nets/__pycache__/layers.cpython-36.pycAdded
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/nets/__pycache__/yolo4.cpython-36.pycAdded
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/nets/__pycache__/yolo_training.cpython-36.pycAdded
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/nets/layers.pyAdded+369
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/nets/yolo4.pyAdded+609
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/nets/yolo_training.pyAdded+690
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/note.txtAdded+2
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/predict.pyAdded+27
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/test.pyAdded+16
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/train.pyAdded+315
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/train_with_tensorboard.pyAdded+334
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/utils/__pycache__/dataloader.cpython-36.pycAdded
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/utils/__pycache__/utils.cpython-36.pycAdded
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/utils/dataloader.pyAdded+272
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/utils/utils.pyAdded+380
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/video.pyAdded+44
- 3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/voc_annotation.pyAdded+40
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353637383932 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text*.docx filter=lfs diff=lfs merge=lfs -text*.doc filter=lfs diff=lfs merge=lfs -text*.jpg filter=lfs diff=lfs merge=lfs -text*.ttf filter=lfs diff=lfs merge=lfs -text
123456<component name="InspectionProjectProfileManager"> <settings> <option name="USE_PROJECT_PROFILE" value="false" /> <version value="1.0" /> </settings></component>1234567<?xml version="1.0" encoding="UTF-8"?><project version="4"> <component name="JavaScriptSettings"> <option name="languageLevel" value="ES6" /> </component> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6 (pytorch)" project-jdk-type="Python SDK" /></project>12345678<?xml version="1.0" encoding="UTF-8"?><project version="4"> <component name="ProjectModuleManager"> <modules> <module fileurl="file://$PROJECT_DIR$/.idea/yolov4_pytorch_down_1fpn.iml" filepath="$PROJECT_DIR$/.idea/yolov4_pytorch_down_1fpn.iml" /> </modules> </component></project>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204<?xml version="1.0" encoding="UTF-8"?><project version="4"> <component name="ChangeListManager"> <list default="true" id="f83c798b-b780-41ee-8bd8-d5cdcce9e80c" name="Default Changelist" comment="" /> <option name="SHOW_DIALOG" value="false" /> <option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="LAST_RESOLUTION" value="IGNORE" /> </component> <component name="ProjectId" id="1sBtOY17GSyAGdXSfVYHcjFhOJG" /> <component name="ProjectViewState"> <option name="hideEmptyMiddlePackages" value="true" /> <option name="showLibraryContents" value="true" /> </component> <component name="PropertiesComponent"> <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" /> <property name="RunOnceActivity.ShowReadmeOnStart" value="true" /> <property name="WebServerToolWindowFactoryState" value="false" /> <property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" /> </component> <component name="RunManager" selected="Python.train"> <configuration name="get_dr_txt" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true"> <module name="yolov4_pytorch_down_1fpn" /> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> <envs> <env name="PYTHONUNBUFFERED" value="1" /> </envs> <option name="SDK_HOME" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="IS_MODULE_SDK" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/get_dr_txt.py" /> <option name="PARAMETERS" value="" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> <option name="MODULE_MODE" value="false" /> <option name="REDIRECT_INPUT" value="false" /> <option name="INPUT_FILE" value="" /> <method v="2" /> </configuration> <configuration name="get_gt_txt" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true"> <module name="yolov4_pytorch_down_1fpn" /> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> <envs> <env name="PYTHONUNBUFFERED" value="1" /> </envs> <option name="SDK_HOME" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="IS_MODULE_SDK" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/get_gt_txt.py" /> <option name="PARAMETERS" value="" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> <option name="MODULE_MODE" value="false" /> <option name="REDIRECT_INPUT" value="false" /> <option name="INPUT_FILE" value="" /> <method v="2" /> </configuration> <configuration name="get_map" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true"> <module name="yolov4_pytorch_down_1fpn" /> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> <envs> <env name="PYTHONUNBUFFERED" value="1" /> </envs> <option name="SDK_HOME" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="IS_MODULE_SDK" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/get_map.py" /> <option name="PARAMETERS" value="" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> <option name="MODULE_MODE" value="false" /> <option name="REDIRECT_INPUT" value="false" /> <option name="INPUT_FILE" value="" /> <method v="2" /> </configuration> <configuration name="kmeans_for_anchors" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true"> <module name="yolov4_pytorch_down_1fpn" /> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> <envs> <env name="PYTHONUNBUFFERED" value="1" /> </envs> <option name="SDK_HOME" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="IS_MODULE_SDK" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/kmeans_for_anchors.py" /> <option name="PARAMETERS" value="" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> <option name="MODULE_MODE" value="false" /> <option name="REDIRECT_INPUT" value="false" /> <option name="INPUT_FILE" value="" /> <method v="2" /> </configuration> <configuration name="train" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true"> <module name="yolov4_pytorch_down_1fpn" /> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> <envs> <env name="PYTHONUNBUFFERED" value="1" /> </envs> <option name="SDK_HOME" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="IS_MODULE_SDK" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/train.py" /> <option name="PARAMETERS" value="" /> <option name="SHOW_COMMAND_LINE" value="false" /> <option name="EMULATE_TERMINAL" value="false" /> <option name="MODULE_MODE" value="false" /> <option name="REDIRECT_INPUT" value="false" /> <option name="INPUT_FILE" value="" /> <method v="2" /> </configuration> <recent_temporary> <list> <item itemvalue="Python.train" /> <item itemvalue="Python.get_map" /> <item itemvalue="Python.get_dr_txt" /> <item itemvalue="Python.get_gt_txt" /> <item itemvalue="Python.kmeans_for_anchors" /> </list> </recent_temporary> </component> <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> <component name="SvnConfiguration"> <configuration /> </component> <component name="TaskManager"> <task active="true" id="Default" summary="Default task"> <changelist id="f83c798b-b780-41ee-8bd8-d5cdcce9e80c" name="Default Changelist" comment="" /> <created>1620357778601</created> <option name="number" value="Default" /> <option name="presentableId" value="Default" /> <updated>1620357778601</updated> <workItem from="1620357780266" duration="20000" /> <workItem from="1620372689464" duration="3893000" /> <workItem from="1624942637778" duration="4085000" /> <workItem from="1632470080395" duration="3414000" /> </task> <servers /> </component> <component name="TypeScriptGeneratedFilesManager"> <option name="version" value="3" /> </component> <component name="WindowStateProjectService"> <state x="539" y="336" width="838" height="395" key="#com.intellij.fileTypes.FileTypeChooser" timestamp="1620393401541"> <screen x="0" y="31" width="1920" height="1000" /> </state> <state x="539" y="336" width="838" height="395" key="#com.intellij.fileTypes.FileTypeChooser/0.31.1920.1000@0.31.1920.1000" timestamp="1620393401541" /> <state x="743" y="290" width="430" height="486" key="FileChooserDialogImpl" timestamp="1620357798011"> <screen x="0" y="31" width="1920" height="1000" /> </state> <state x="743" y="290" width="430" height="486" key="FileChooserDialogImpl/0.31.1920.1000@0.31.1920.1000" timestamp="1620357798011" /> <state width="1878" height="262" key="GridCell.Tab.0.bottom" timestamp="1624949050369"> <screen x="0" y="31" width="1920" height="1000" /> </state> <state width="1878" height="262" key="GridCell.Tab.0.bottom/0.31.1920.1000@0.31.1920.1000" timestamp="1624949050369" /> <state width="1878" height="262" key="GridCell.Tab.0.center" timestamp="1624949050369"> <screen x="0" y="31" width="1920" height="1000" /> </state> <state width="1878" height="262" key="GridCell.Tab.0.center/0.31.1920.1000@0.31.1920.1000" timestamp="1624949050369" /> <state width="1878" height="262" key="GridCell.Tab.0.left" timestamp="1624949050368"> <screen x="0" y="31" width="1920" height="1000" /> </state> <state width="1878" height="262" key="GridCell.Tab.0.left/0.31.1920.1000@0.31.1920.1000" timestamp="1624949050368" /> <state width="1878" height="262" key="GridCell.Tab.0.right" timestamp="1624949050369"> <screen x="0" y="31" width="1920" height="1000" /> </state> <state width="1878" height="262" key="GridCell.Tab.0.right/0.31.1920.1000@0.31.1920.1000" timestamp="1624949050369" /> <state x="449" y="167" width="1022" height="732" key="SettingsEditor" timestamp="1624942705918"> <screen x="0" y="31" width="1920" height="1000" /> </state> <state x="449" y="167" width="1022" height="732" key="SettingsEditor/0.31.1920.1000@0.31.1920.1000" timestamp="1624942705918" /> </component> <component name="com.intellij.coverage.CoverageDataManagerImpl"> <SUITE FILE_PATH="coverage/yolov4_pytorch_down_1fpn$get_gt_txt.coverage" NAME="get_gt_txt Coverage Results" MODIFIED="1624948823134" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/yolov4_pytorch_down_1fpn$get_dr_txt.coverage" NAME="get_dr_txt Coverage Results" MODIFIED="1624948827488" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/yolov4_pytorch_down_1fpn$voc_annotation.coverage" NAME="voc_annotation Coverage Results" MODIFIED="1624947452654" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/yolov4_pytorch_down_1fpn$get_map.coverage" NAME="get_map Coverage Results" MODIFIED="1624948901955" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/yolov4_pytorch_down_1fpn$FPS_test.coverage" NAME="FPS_test Coverage Results" MODIFIED="1620383960986" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/yolov4_pytorch_down_1fpn$voc2yolo4.coverage" NAME="voc2yolo4 Coverage Results" MODIFIED="1624947205926" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/VOCdevkit/VOC2007" /> <SUITE FILE_PATH="coverage/yolov4_pytorch_down_1fpn$train.coverage" NAME="train Coverage Results" MODIFIED="1624949050360" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> <SUITE FILE_PATH="coverage/yolov4_pytorch_down_1fpn$kmeans_for_anchors.coverage" NAME="kmeans_for_anchors Coverage Results" MODIFIED="1624947972837" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" /> </component></project>123456789101112<?xml version="1.0" encoding="UTF-8"?><module type="PYTHON_MODULE" version="4"> <component name="NewModuleRootManager"> <content url="file://$MODULE_DIR$" /> <orderEntry type="jdk" jdkName="Python 3.6 (pytorch)" jdkType="Python SDK" /> <orderEntry type="sourceFolder" forTests="false" /> </component> <component name="PyDocumentationSettings"> <option name="format" value="PLAIN" /> <option name="myDocStringFormat" value="Plain" /> </component></module>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/abendstimmung-sunset-evening-sky-817715.jpg 805,321,1077,672,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/adventure-of-the-seas-cruise-ship-caribb-1218316.jpg 367,253,1000,523,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/africa-river-botswana-water-landscape-na-172697.jpg 643,419,864,515,1/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/aida-driving-cruise-ship-sea-night-114556.jpg 23,322,1276,555,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/anchored-boats-ocean-nautical-sailboat-b-2047077.jpg 225,99,576,690,7 809,329,1063,656,7 556,466,702,650,7 127,398,274,659,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/antarctic-midnight-sun-kayak-polar-3474502.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/archipelago-sailboat-mast-boats-434809.jpg 146,409,214,641,7 287,387,348,649,7 644,181,782,654,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/architecture-buildings-city-cityscape-cl-1839097.jpg 528,636,596,703,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/barges-canal-sunset-dusk-evening-719975.jpg 462,476,749,724,2 293,416,483,510,2 480,386,646,478,2 596,374,719,434,2/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/battleship-pirate-ship-sailboat-warship--1688093.jpg 351,108,999,502,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/beach-buoy-w-water-sea-ocean-1042883.jpg 628,37,1048,782,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/beach-ocean-summer-landscape-2920655.jpg 2,414,1275,516,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/beach-sea-ocean-sunset-boats-1208504.jpg 13,553,730,791,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boat-dawn-dusk-mast-ocean-sailboat-saili-1867174.jpg 378,214,944,1093,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boat-ferry-black-forest-lake-123642.jpg 219,675,779,863,1/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boat-fog-marine-loneliness-nature-2333306.jpg 614,1071,653,1131,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boat-haze-ship-alone-marine-water-1819696.jpg 823,654,867,710,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boat-litoral-fishermen-beach-2646175.jpg 82,234,765,394,0 688,287,1207,386,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boat-ocean-sea-water-sunset-3729971.jpg 902,101,1221,524,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boat-sailboat-sail-sea-nature-17778.jpg 515,323,724,595,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boat-sailboat-sunset-navigation-boat-boa-1787261.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boat-sailing-boat-rest-calm-silent-1992137.jpg 302,335,571,693,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boat-sailing-canal-sail-ship-sun-sky-wat-2112210.jpg 445,330,573,685,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boat-sea-horizon-island-small-sail-summe-950359.jpg 260,268,406,546,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boat-sea-horizon-seascape-sailboat-2861565.jpg 305,203,476,353,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boat-sea-inflatable-boat-coast-2646811.jpg 52,429,819,747,4/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boat-summer-sea-ship-sail-travel-1634811.jpg 333,82,471,349,7 303,150,1046,731,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boat-sunset-sea-sunbeam-sail-721937.jpg 848,325,959,479,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boats-marina-dock-water-harbor-sea-nauti-802067.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boats-sea-port-blue-water-summer-3638570.jpg 869,26,1034,578,7 644,183,879,572,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boats-yacht-bay-ship-water-sea-2758960.jpg 284,31,473,638,7 166,139,724,574,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boats-yacht-ship-water-sea-marina-2758962.jpg 532,61,1064,606,7 629,64,827,673,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/body-of-water-sea-ocean-boat-3183509.jpg 251,101,594,670,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/body-of-water-sea-sunset-sailboat-3179387.jpg 550,123,719,472,7 1018,27,1258,535,7 160,328,247,462,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/boracay-sunset-philippines-beach-3031029.jpg 240,261,430,531,7 474,419,589,523,7 652,451,754,522,7 801,435,877,521,7 896,339,985,519,7 94,352,243,521,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/buoy-scheepvaartmarkering-2714628.jpg 649,179,713,400,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/buoy-sky-coastal-blue-travel-3568365.jpg 311,107,655,771,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/buoy-sunset-ocean-water-sky-sea-nature-b-1094912.jpg 590,270,704,517,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/buoy-water-keyhaven-united-states-of-ame-828029.jpg 178,106,280,194,8 564,193,787,452,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/buoy-yellow-lake-winter-pond-ice-933324.jpg 614,564,697,670,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/buoys-river-boats-stein-am-rhein-113406.jpg 154,208,242,319,8 436,205,514,278,8 458,96,539,171,8 902,52,975,122,8 979,4,1071,70,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/buoys-water-lake-safety-lifesaver-791339.jpg 873,644,939,680,8 888,553,935,587,8 887,522,938,551,8 884,483,933,515,8 887,385,924,410,8 891,347,931,373,8 897,309,940,336,8 905,279,939,304,8 903,251,939,270,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/buoys-water-series-arrangement-3567037.jpg 123,988,268,1130,8 212,700,300,805,8 254,532,326,621,8 282,437,336,509,8 302,377,360,438,8 316,321,362,382,8 327,276,364,326,8 336,245,379,284,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/california-panorama-sea-ocean-2686349.jpg 482,161,745,605,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/canoe-explore-travel-water-3595673.jpg 206,386,657,588,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/canoe-water-nature-natural-outdoors-envi-49179.jpg 587,413,970,774,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/canoeing-sport-water-sea-paddle-3600550.jpg 554,409,882,481,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/career-paper-origami-leader-marina-marin-1738216.jpg 124,449,627,662,6 693,305,988,468,6 840,230,1078,348,6 1087,273,1277,426,6 770,383,1155,581,6/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/caribbean-sunset-sailboat-palmtree-ocean-1504584.jpg 155,328,343,568,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/caribbean-sunset-soap-bubble-ball-851218.jpg 265,183,787,702,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/catamaran-sailing-boat-sailboat-3582541.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/catamaran-sailing-sailboat-boat-199153.jpg 533,293,703,727,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cave-grotto-vacations-sardinia-memory-me-2077979.jpg 770,375,859,501,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/channel-facade-water-building-city-3542819.jpg 452,552,1119,713,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/channel-gondola-venice-italy-water-3542800.jpg 741,254,989,660,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/channel-venice-gondolas-italy-3547224.jpg 470,560,884,647,3 646,594,1130,722,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailing-sailboat-boat-travel-2542901.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailing-ship-maritime-ship-sea-3212545.jpg 202,40,837,676,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailing-ship-sailing-boat-calm-384677.jpg 655,447,820,658,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailing-vessel-ship-sail-sea-ocean-shipp-1877540.jpg 395,537,654,883,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailing-vessel-water-boat-afterglow-3405209.jpg 520,280,761,730,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sea-boat-horizon-sailboats-seascape-land-2056853.jpg 238,449,397,670,7 376,446,479,658,7 467,412,611,662,7 619,427,707,666,7 678,449,825,665,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sea-boat-sunset-ocean-water-yacht-sailbo-2141613.jpg 404,228,827,643,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sea-buoys-mist-fog-morning-card-605387.jpg 350,596,429,684,8 536,546,606,609,8 527,494,595,547,8 464,464,516,516,8 431,436,472,478,8 353,421,404,456,8 282,381,322,413,8 1157,225,1205,310,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sea-ferry-ocean-travel-boat-water-2820332.jpg 1082,273,1227,345,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sea-nature-sky-exotic-clouds-red-68052.jpg 838,454,964,631,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sea-ocean-boats-sailboats-beach-1357885.jpg 193,521,224,573,7 260,521,294,570,7 314,515,348,575,7 505,515,528,571,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sea-ocean-water-waves-nature-2561397.jpg 936,424,996,517,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sea-sailboat-sailing-sunset-2907762.jpg 972,431,1027,488,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sea-sailboat-sunset-sailboat-sailboat-sa-2091933.jpg 872,276,1092,621,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sea-sailing-boat-water-ship-sail-3726854.jpg 423,96,725,529,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sea-sailing-boat-water-ship-sail-3726855.jpg 402,142,558,403,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sea-sunset-ocean-bay-calm-quiet-406804.jpg 677,357,734,431,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sea-water-sunset-ocean-dawn-3302915.jpg 129,81,1208,736,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ship-away-boat-vase-water-red-316558.jpg 177,431,373,547,6 422,636,691,780,6 696,490,1243,723,6/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ship-away-boat-vase-water-red-paper-boat-315308.jpg 521,351,743,504,6/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ship-balance-stars-magic-fantasy-2804076.jpg 718,305,981,744,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ship-boat-cruise-liner-harbor-port-76670.jpg 98,304,1192,561,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ship-boat-lake-sailing-boat-italy-952292.jpg 544,191,994,660,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ship-boat-marine-water-blue-sail-3755995.jpg 175,528,391,674,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ship-cruise-cruise-ship-vacations-2756487.jpg 13,18,1273,834,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ship-cruise-ship-travel-sea-cruise-sky-t-1656608.jpg 348,359,1021,575,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ship-ocean-sea-horizon-sunset-sunrise-na-918553.jpg 236,362,332,476,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ship-sailing-vessel-seafaring-2904969.jpg 310,33,1118,833,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ship-sea-tourism-journey-water-2762527.jpg 48,119,931,672,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ship-sea-wave-romance-sails-1505929.jpg 219,213,667,768,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ship-tall-vessel-sea-sailing-647058.jpg 131,202,730,645,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ship-vacations-cruise-cruises-425064.jpg 98,197,904,573,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/shipping-containers-wharf-wharves-harbou-1150062.jpg 563,295,1280,509,2/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/shipping-seafaring-ship-cruise-3649676.jpg 105,371,1199,609,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ships-sailing-boat-boat-sailing-colorful-162075.jpg 107,258,400,660,7 288,297,635,766,7 545,146,826,669,7 693,380,999,757,7 817,260,1194,674,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ships-tall-sailing-vessels-sea-642520.jpg 109,208,500,602,7 802,339,1036,581,7 1074,406,1202,584,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ships-travel-sea-boat-cruise-3481704.jpg 406,431,818,536,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sky-dusk-darkness-evening-waters-3054732.jpg 823,368,939,500,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sky-nature-water-sea-outdoors-3332068.jpg 294,466,336,515,8 541,416,566,448,8 407,401,435,423,8 315,388,339,405,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/smooth-shiny-water-bright-satin-3054850.jpg 828,370,932,501,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/summer-buoy-water-late-summer-sweden-buo-916796.jpg 601,853,695,1062,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunrise-sunset-sun-sky-landscape-summer--2014053.jpg 521,279,640,380,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-bay-sea-mood-abendstimmung-sky-na-660446.jpg 101,521,298,562,2 846,524,1022,555,2/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-boat-sea-sailboat-landscape-horiz-1747744.jpg 568,531,680,599,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-dawn-sky-evening-panorama-3126715.jpg 658,257,772,431,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-kayaking-lake-summer-3631742.jpg 477,314,715,351,5 679,301,961,357,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-monolithic-part-of-the-waters-3122072.jpg 165,377,245,484,7 226,370,295,486,7 1021,201,1262,496,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-mountains-kayak-oar-water-2831769.jpg 414,502,829,569,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-nature-waters-dusk-dawn-3087790.jpg 827,284,903,389,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-sailing-boat-boat-sea-ship-675847.jpg 706,104,1019,765,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-sailing-boat-lighthouse-sun-3759029.jpg 582,366,659,472,7 91,358,137,470,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-sailing-boat-maldives-sea-90952.jpg 559,356,693,473,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-sailing-ship-superstructure-1136147.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-sea-clouds-key-west-324128.jpg 324,647,350,689,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-sea-ocean-sailing-boat-ship-3140356.jpg 682,212,1057,705,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-sky-sailboats-lake-water-horizon--923930.jpg 231,408,282,477,7 576,374,688,494,7 832,367,910,485,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-water-ocean-buoy-dusk-sky-orb-wav-1021058.jpg 549,314,746,704,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-water-ocean-buoy-dusk-sky-reflect-802963.jpg 751,405,811,506,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-water-sea-ocean-sailboat-3187225.jpg 638,240,1013,574,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sunset-waters-sun-sea-reflection-3049610.jpg 417,268,592,461,7 860,287,1056,444,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sydney-australia-sydney-opera-house-sydn-296027.jpg 190,446,553,567,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sydney-port-twilight-australia-2766957.jpg 438,528,604,601,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/travel-cruise-cruise-line-water-ocean-va-967984.jpg 183,474,382,574,0 931,329,1159,579,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/trimaran-yacht-sailing-sailing-ship-2806616.jpg 46,47,1011,1177,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/vacation-sailboat-vessel-sailboat-sailbo-1003660.jpg 406,160,624,499,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/vacations-holidays-sea-lake-sailing-boat-2062299.jpg 458,102,675,537,7 340,173,465,437,7 693,268,754,358,7 879,257,947,357,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-gondola-evening-water-italy-2814768.jpg 555,592,1048,714,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-gondola-fantasy-moon-mask-2070965.jpg 358,67,990,307,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-gondola-italy-2712852.jpg 5,551,559,689,3 463,549,861,734,3 819,580,1025,781,3 1050,580,1191,801,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-gondola-sunset-italian-boat-venet-1546900.jpg 548,583,841,714,3 407,578,759,680,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-gondola-water-boat-canal-594615.jpg 528,416,1280,677,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-gondolas-boats-water-sunset-dusk--924092.jpg 9,407,504,751,3 360,454,626,770,3 779,450,1035,756,3 866,435,1240,596,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-gondolas-italy-venezia-194835.jpg 74,519,362,742,3 390,547,566,781,3 570,536,763,795,3 746,524,999,783,3 877,511,1275,764,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-gondolas-parking-port-dock-1559354.jpg 115,368,680,637,3 542,365,817,623,3 863,390,1034,646,3 1029,373,1254,636,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-italy-architecture-sunset-1603273.jpg 193,606,271,654,3 565,572,635,611,1 930,605,1109,663,3 1101,650,1271,697,3 830,609,975,644,3 341,513,450,580,1/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-italy-canal-landmark-city-3733156.jpg 399,562,907,711,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-italy-channel-gondolas-2923519.jpg 338,399,655,642,3 764,291,937,530,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-italy-gondola-boat-channel-2855270.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-italy-gondola-lagoon-romantic-was-1035632.jpg 100,471,575,608,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-italy-gondola-romantic-1035684.jpg 194,463,672,725,3 751,459,1030,711,3 772,460,902,564,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-italy-water-architecture-building-2013436.jpg 448,301,534,338,3 243,321,407,346,3 133,384,360,615,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-st-mark-s-square-quarell-3448577.jpg 208,989,537,1171,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/venice-venice-carnival-mask-costume-pane-2100155.jpg 91,201,1168,683,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/vessel-loading-port-bay-cargo-2091454.jpg 304,507,621,749,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/vessel-port-loading-ship-sea-transportat-2091798.jpg 635,423,1036,684,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/water-boats-buoys-shipping-river-113474.jpg 636,525,690,608,8 159,547,212,606,8 306,506,363,573,8 695,467,760,531,8 745,449,808,512,8 795,513,859,568,8 1124,433,1172,497,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/water-buoys-shipping-river-113476.jpg 159,468,380,721,8 384,247,659,434,8 605,197,849,369,8 804,422,1054,605,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/water-kayak-holiday-rafting-3458877.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/water-lake-boat-landscape-sun-fog-3398111.jpg 220,528,429,553,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/water-ocean-sea-sailboat-sailing-2631744.jpg 164,606,237,693,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/water-sailboat-serene-ocean-calm-14687.jpg 281,372,539,609,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/water-sailboat-watercraft-travel-3288854.jpg 91,209,627,1150,7 783,487,1130,991,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/waters-gold-golden-water-lake-3054738.jpg 949,411,1060,538,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/waters-gondola-boat-travel-sky-3247690.jpg 212,287,704,578,3 773,239,975,605,3 964,250,1255,576,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/waters-kayak-canoeing-paddle-water-2687791.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/waters-lake-nature-reflection-3071288.jpg 671,398,1154,749,1/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/waters-sea-ship-boat-3176281.jpg 107,277,1157,521,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/waters-yacht-sea-sailing-boat-port-3084271.jpg 357,48,489,451,7 461,146,566,455,7 612,161,711,447,7 715,143,808,447,7 905,177,982,471,7 988,154,1092,462,7 1160,180,1247,460,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/yacht-boat-sea-sailboat-marine-yachting--1934226.jpg 376,575,756,1121,7 106,630,241,1119,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/yacht-port-sailboat-784121.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/yachts-sail-sea-water-boat-travel-nautic-2107526.jpg 640,4,921,583,7 840,7,1148,583,7 450,1,706,591,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/childhood-paper-boat-simple-paper-3559166.jpg 550,205,1041,537,6/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/costa-pacifica-kiel-baltic-sea-port-3650089.jpg 251,205,888,349,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-caribbean-aida-sunset-vacations-s-778531.jpg 348,395,853,717,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-north-america-passenger-ship-1267024.jpg 104,156,1190,628,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-ship-boat-sea-cruise-travel-189938.jpg 287,164,1173,675,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-ship-cruise-ship-twilight-108973.jpg 48,240,1205,487,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-ship-cruises-108974.jpg 38,293,1242,543,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-ship-dock-night-reflection-water--1156012.jpg 253,207,913,608,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-ship-dock-vessel-boat-port-harbor-1146058.jpg 108,209,1071,739,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-ship-dock-vessel-boat-port-harbor-1396681.jpg 223,123,996,653,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-ship-elbe-hamburg-ship-3526709.jpg 131,310,1120,626,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-ship-sea-vacations-port-holiday-c-1218305.jpg 377,388,554,569,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-ship-serenade-of-the-seas-3484814.jpg 257,371,863,586,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-ship-serenade-of-the-seas-3484854.jpg 185,324,933,547,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-ship-shelf-princess-sunset-3547180.jpg 87,134,1044,649,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-ship-ship-cruise-vacations-sea-wa-788369.jpg 339,295,857,598,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-ship-sunset-travel-sea-vacation-o-601527.jpg 404,421,615,532,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-ship-transportation-2777910.jpg 316,265,901,660,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-ship-tug-boat-ocean-sea-3714026.jpg 562,162,1222,732,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruise-ships-port-dock-cruising-339329.jpg 651,248,861,386,0 1081,218,1221,431,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/cruising-ships-palm-trees-sunset-690568.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/dawn-papierschiff-ship-sea-sunset-3361172.jpg 116,111,467,415,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/des-moines-lake-kayak-iowa-des-2652691.jpg 508,685,622,744,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/eat-food-ice-ice-cream-3691222.jpg 146,230,1046,713,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/emotions-nature-rest-sailing-boat-3658967.jpg 220,166,433,450,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/emotions-travel-holidays-italy-3490223.jpg 226,341,1089,683,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/evening-lake-water-sailing-boat-3793471.jpg 969,428,1012,548,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ferry-cruise-swimming-shipping-2865442.jpg 181,222,455,393,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ferry-sunset-puget-sound-fish-cruise-shi-958685.jpg 629,505,1048,604,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/fishing-buoy-sunset-water-orange-float-m-590688.jpg 352,225,623,383,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/fog-landscape-nature-sun-2886563.jpg 71,10,307,761,7 286,6,507,750,7 535,8,738,753,7 760,1,956,759,7 963,23,1169,757,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/fog-landscape-nature-sun-2886564.jpg 203,488,263,617,7 288,490,356,623,7 410,492,486,623,7 546,499,598,621,7 576,489,672,626,7 754,492,832,628,7 877,493,969,621,7 969,483,1039,627,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/freight-tanker-vessel-boat-ship-oil-carg-863449.jpg 189,523,704,820,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/gondola-channel-navigation-venetian-3247370.jpg 944,671,1115,838,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/greece-boats-sailboat-sea-ocean-2665945.jpg 190,294,317,516,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/greece-sea-ocean-mountains-2693408.jpg 889,499,963,603,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/greenland-boat-sailboat-ice-nature-ship--459793.jpg 213,416,392,607,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/hawaii-sunset-sailboat-yellow-orange-oce-1421081.jpg 248,464,306,525,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/iceland-cruise-ships-cruise-cruise-cruis-262739.jpg 712,436,922,521,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/image-picture-photo-sea-ocean-sailing-sa-98475.jpg 685,293,1036,631,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/kayak-adventure-discover-water-row-846078.jpg 732,434,802,455,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/kayak-kayakers-water-sports-paddle-rowin-59617.jpg 371,424,1261,592,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/kayak-nature-landscape-summer-3709004.jpg 327,577,422,614,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/kayak-nature-water-summer-paddle-3678281.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/kayak-rowing-relax-lake-haze-2858872.jpg 365,238,506,267,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/kayak-sunset-water-nature-summer-3705662.jpg 291,426,486,497,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/kayak-water-blue-leisure-activity-outdoo-963160.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/kayak-water-swimming-kayaks-summer-3738459.jpg 682,346,884,370,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/kayak-white-water-water-sports-courage-s-798009.jpg 289,262,759,744,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/kayakers-kayak-paddle-rowing-water-canoe-3941.jpg 836,499,1010,635,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/kayaking-canoing-lakes-streams-creeks-wa-1149886.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/kayaking-water-sport-activity-outdoors-b-1814426.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/kayaks-beached-lake-yellowstone-1405994.jpg 171,434,491,562,5 660,449,971,532,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/kayaks-lake-nature-landscape-river-1306723.jpg 587,390,675,430,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/lake-balaton-nature-landscape-2640179.jpg 601,409,719,543,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/lake-dock-sunset-serene-boats-pier-sailb-405657.jpg 823,297,915,472,7 231,304,293,468,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/lake-kayak-fishing-summer-beautiful-land-404797.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/lake-sunrise-morning-water-3617527.jpg 414,1,647,505,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/lake-sunset-abendstimmung-evening-3452510.jpg 890,132,973,411,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/lake-water-buoy-sunset-pond-1366314.jpg 873,426,962,564,8 587,313,672,427,8 339,224,405,318,8/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/lake-water-sunshine-summer-canoe-kayak-t-690731.jpg 649,526,695,541,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/landscape-solar-nature-sky-sunset-3730029.jpg 403,369,525,532,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/landscape-twilight-marina-porto-3524381.jpg 1008,51,1255,541,7 359,63,531,508,7 519,53,717,506,7 207,113,368,506,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/landscape-yacht-sunrise-reflection-1802340.jpg 262,199,368,424,7 1039,221,1193,430,7 930,222,1032,429,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/life-beauty-scene-transit-863028.jpg 102,368,556,460,2 951,368,1192,453,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/marina-boat-river-water-landscape-2192107.jpg 319,439,545,735,7 586,511,711,714,7 705,559,795,707,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/mast-rigging-ship-sailboat-tall-ship-sun-983904.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/mast-sailboat-sailing-clouds-cloudy-sky--925270.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/morning-hours-sunrise-morning-sun-3585522.jpg 197,31,1009,708,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/nature-architecture-venice-gondola-3190721.jpg 79,455,261,758,3 269,437,460,783,3 534,438,942,693,3/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/nature-landscape-lake-sea-sail-2032666.jpg 475,103,655,521,7 342,169,464,430,7 696,254,768,351,7 888,262,939,363,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/nature-storm-kayak-rain-3391224.jpg 934,509,1035,536,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/norway-fjord-lake-water-reflections-crui-1945489.jpg 232,467,596,619,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/nyc-sunset-sailboat-reflections-216106.jpg 856,578,1016,706,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ocean-sunset-atlantic-ocean-barbados-sai-1549556.jpg 621,393,679,460,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/ocean-water-nature-boat-horizon-3762815.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/oil-tankers-supertankers-oil-tankers-336718.jpg 249,337,373,362,2 601,337,720,362,2 938,330,1049,357,2/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/paddle-kayak-canoe-explore-ocean-839814.jpg 446,601,576,688,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/panorama-chiemsee-landscape-nature-2702126.jpg 677,284,793,473,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/paper-boat-coloured-colored-2770974.jpg 159,526,335,604,6 133,615,320,703,6 351,524,428,604,6 401,539,531,619,6 438,500,603,582,6 768,464,947,563,6 1005,447,1179,538,6/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/paper-boat-origami-2570218.jpg 314,270,956,516,6/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/papierschiff-paper-ship-fold-635402.jpg 209,249,878,543,6/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/photomontage-bay-water-sailing-boat-2404867.jpg 575,439,702,626,7 109,689,336,775,1/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/photomontage-water-sea-sailing-boat-2399241.jpg 527,285,713,417,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/pirate-ship-sea-moon-fantasy-ocean-sail--1719396.jpg 245,208,574,498,7 819,279,966,465,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/port-loading-discharging-ship-cargo-tran-2090729.jpg 369,262,766,600,0/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/port-ship-dsseldorf-media-harbour-2328702.jpg 377,450,1026,780,2/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/portland-oregon-river-canoe-portland-ore-1147712.jpg 206,421,693,492,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/rainbow-moon-lake-sailing-boat-sail-peac-453101.jpg 622,552,711,632,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/rhodes-lindos-sun-morning-sailboat-2739362.jpg 727,315,1070,563,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/river-water-leisure-kayak-paddling-sunse-691395.jpg 604,416,685,436,5/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/river-yachts-sunrise-cork-crosshaven-ire-2057687.jpg 165,148,234,397,7 839,23,966,415,7 729,47,819,390,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sail-boat-ocean-black-and-hite-boat-2521055.jpg 767,123,1109,641,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sail-horizon-orange-gloss-water-3760717.jpg 665,533,700,568,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sail-sailboat-vessel-yacht-charter-863082.jpg 143,146,450,577,7 653,105,984,578,7 929,161,1181,554,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sail-sea-sailing-boat-boats-water-water--1238055.jpg 619,112,862,731,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sail-sunset-sea-water-ocean-3585674.jpg 414,342,486,429,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailboat-boat-holidays-cruise-sea-3407027.jpg 619,346,667,423,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailboat-boat-leisure-recreation-2693421.jpg 148,13,653,784,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailboat-boat-ship-sail-sailing-2423484.jpg 460,93,625,485,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailboat-ibiza-summer-sunset-2894220.jpg 467,693,715,1003,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailboat-ocean-harbor-bay-port-1623321.jpg 382,82,604,552,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailboat-sailing-boat-sunset-427602.jpg 691,503,851,671,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailboat-sailing-river-boat-sea-2431579.jpg 335,194,705,665,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailboat-sailing-sky-clouds-sea-2530235.jpg 502,823,546,859,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailboat-sky-boat-sail-travel-sail-boat--1031741.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailboat-sunrise-yole-323164.jpg 494,5,743,657,7 346,356,411,571,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailboat-sunset-sea-ocean-dark-3348374.jpg 298,130,838,770,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailboat-water-dusk-vertical-summer-yach-673555.jpg 241,778,345,966,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailboat-water-sunset-vacation-yacht-sai-414509.jpg/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailboats-sailing-water-ocean-sea-yacht--1734842.jpg 174,239,362,603,7 488,203,715,586,7 845,277,1052,592,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailing-boat-lake-sailing-boat-596462.jpg 516,426,617,663,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailing-boat-mastes-rigging-boat-sail-se-983933.jpg 199,28,855,683,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailing-boat-ocean-open-water-sea-569336.jpg 274,363,299,414,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailing-boat-sailing-yacht-3399014.jpg 285,4,703,813,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailing-boat-sea-ship-water-2407303.jpg 418,166,618,443,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailing-boat-shore-sky-sand-sea-sail-sum-1645394.jpg 852,314,968,471,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailing-boat-sunset-summer-nature-3758189.jpg 302,203,758,806,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailing-boats-carboats-calm-quiet-384671.jpg 565,280,704,485,7 1012,341,1084,463,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailing-boats-sea-ocean-leisure-sports-s-601541.jpg 594,506,672,603,7 879,521,950,600,7 1073,517,1125,594,7/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/JPEGImages/sailing-racing-regatta-j-105-105-2455969.jpg 393,232,639,672,7123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119import colorsysimport osimport time
import cv2import numpy as npimport torchimport torch.backends.cudnn as cudnnimport torch.nn as nnfrom PIL import Image, ImageDraw, ImageFontfrom torch.autograd import Variablefrom tqdm import tqdm
from nets.yolo4 import YoloBodyfrom utils.utils import (DecodeBox, bbox_iou, letterbox_image, non_max_suppression, yolo_correct_boxes)from yolo import YOLO
'''该FPS测试不包括前处理(归一化与resize部分)、绘图。包括的内容为:网络推理、得分门限筛选、非极大抑制。使用'img/street.jpg'图片进行测试,该测试方法参考库https://github.com/zylo117/Yet-Another-EfficientDet-Pytorch
video.py里面测试的FPS会低于该FPS,因为摄像头的读取频率有限,而且处理过程包含了前处理和绘图部分。'''class FPS_YOLO(YOLO): def get_FPS(self, image, test_interval): # 调整图片使其符合输入要求 image_shape = np.array(np.shape(image)[0:2])
#---------------------------------------------------------# # 给图像增加灰条,实现不失真的resize # 也可以直接resize进行识别 #---------------------------------------------------------# if self.letterbox_image: crop_img = np.array(letterbox_image(image, (self.model_image_size[1],self.model_image_size[0]))) else: crop_img = image.convert('RGB') crop_img = crop_img.resize((self.model_image_size[1],self.model_image_size[0]), Image.BICUBIC) photo = np.array(crop_img,dtype = np.float32) / 255.0 photo = np.transpose(photo, (2, 0, 1)) #---------------------------------------------------------# # 添加上batch_size维度 #---------------------------------------------------------# images = [photo]
with torch.no_grad(): images = torch.from_numpy(np.asarray(images)) if self.cuda: images = images.cuda() outputs = self.net(images) output_list = [] for i in range(3): output_list.append(self.yolo_decodes[i](outputs[i])) output = torch.cat(output_list, 1) batch_detections = non_max_suppression(output, len(self.class_names), conf_thres=self.confidence, nms_thres=self.iou) try: batch_detections = batch_detections[0].cpu().numpy() top_index = batch_detections[:,4]*batch_detections[:,5] > self.confidence top_conf = batch_detections[top_index,4]*batch_detections[top_index,5] top_label = np.array(batch_detections[top_index,-1],np.int32) top_bboxes = np.array(batch_detections[top_index,:4]) top_xmin, top_ymin, top_xmax, top_ymax = np.expand_dims(top_bboxes[:,0],-1),np.expand_dims(top_bboxes[:,1],-1),np.expand_dims(top_bboxes[:,2],-1),np.expand_dims(top_bboxes[:,3],-1) if self.letterbox_image: boxes = yolo_correct_boxes(top_ymin,top_xmin,top_ymax,top_xmax,np.array([self.model_image_size[0],self.model_image_size[1]]),image_shape) else: top_xmin = top_xmin / self.model_image_size[1] * image_shape[1] top_ymin = top_ymin / self.model_image_size[0] * image_shape[0] top_xmax = top_xmax / self.model_image_size[1] * image_shape[1] top_ymax = top_ymax / self.model_image_size[0] * image_shape[0] boxes = np.concatenate([top_ymin,top_xmin,top_ymax,top_xmax], axis=-1) except: pass t1 = time.time() for _ in range(test_interval): with torch.no_grad(): outputs = self.net(images) output_list = [] for i in range(3): output_list.append(self.yolo_decodes[i](outputs[i])) output = torch.cat(output_list, 1) batch_detections = non_max_suppression(output, len(self.class_names), conf_thres=self.confidence, nms_thres=self.iou) try: batch_detections = batch_detections[0].cpu().numpy() top_index = batch_detections[:,4]*batch_detections[:,5] > self.confidence top_conf = batch_detections[top_index,4]*batch_detections[top_index,5] top_label = np.array(batch_detections[top_index,-1],np.int32) top_bboxes = np.array(batch_detections[top_index,:4]) top_xmin, top_ymin, top_xmax, top_ymax = np.expand_dims(top_bboxes[:,0],-1),np.expand_dims(top_bboxes[:,1],-1),np.expand_dims(top_bboxes[:,2],-1),np.expand_dims(top_bboxes[:,3],-1) if self.letterbox_image: boxes = yolo_correct_boxes(top_ymin,top_xmin,top_ymax,top_xmax,np.array([self.model_image_size[0],self.model_image_size[1]]),image_shape) else: top_xmin = top_xmin / self.model_image_size[1] * image_shape[1] top_ymin = top_ymin / self.model_image_size[0] * image_shape[0] top_xmax = top_xmax / self.model_image_size[1] * image_shape[1] top_ymax = top_ymax / self.model_image_size[0] * image_shape[0] boxes = np.concatenate([top_ymin,top_xmin,top_ymax,top_xmax], axis=-1) except: pass
t2 = time.time() tact_time = (t2 - t1) / test_interval return tact_time yolo = FPS_YOLO()test_interval = 100img = Image.open('img/street.jpg')tact_time = yolo.get_FPS(img, test_interval)print(str(tact_time) + ' seconds, ' + str(1/tact_time) + 'FPS, @batch_size 1')#53.0198fps123456789101112131415161718192021MIT License
Copyright (c) 2020 JiaQi Xu
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137CRB-NET代码是基于YOLOV4进行改进,改进的地方主要包括以下几个地方:1. 在nets文件夹下CSPdarknet下的CSPDarkNet函数中多加了一层(line147),CSPdarknet下的darknet53函数数组中多加了一个特征层参数2(line173)。2. 在nets文件夹下引入了layers文件,主要是未来后续调用其中的Conv2dStaticSamePadding, MaxPool2dStaticSamePadding, MemoryEfficientSwish, Swish。3. 在nets文件夹下的yolo_training文件中,lin121行将原始3个输出特征层改成了5个,line238中的3个特征层的anchor改成了5个,line239中的3个特征层的anchor的index改成了5个,line243--line255的3个特征层的改成了5个,line239中的3个特征层的anchor的index改成了5个,line367的3个特征层的anchor的index改成了5个,line381,line384的3个特征层index改成了5个4. 在nets文件夹下的yolo4文件中,line2--line3引入layers文件。line402--Line609对应着CRB-NET的两次SPP,带有通道注意力机制的BIFPN,以及五个输出特征层的解码过程。5. kmeans_for_anchors文件是用于训练前的聚类,line88和line89行对应着输入尺寸和种类个数。6. get_sizemap是用来统计真实值和检测值中不同大小物体的检测精度,这部分代码全是自己写的。7.注意全部都将原始图片resize到了512x5128. yolo文件的line105,line150改成对5个特征层做anchor的计算。9. train文件的line112, line205, line75改成对训练集做5个维度的loss计算10. get_dr_txt文件改成对输入图的5个特征层做预测。
CRB-NET代码使用步骤:## 目录1. [性能情况 Performance](#性能情况)2. [实现的内容 Achievement](#实现的内容)3. [所需环境 Environment](#所需环境)4. [注意事项 Attention](#注意事项)5. [小技巧的设置 TricksSet](#小技巧的设置)6. [文件下载 Download](#文件下载)7. [预测步骤 How2predict](#预测步骤)8. [训练步骤 How2train](#训练步骤)9. [评估步骤 How2eval](#评估步骤)10. [参考资料 Reference](#Reference)
## 性能情况| 训练数据集 | 权值文件名称 | 测试数据集 | 输入图片大小 | mAP 0.5:0.95 | mAP 0.5 || :-----: | :-----: | :------: | :------: | :------: | :-----: || VOC07+12+COCO | [yolo4_voc_weights.pth](https://github.com/bubbliiiing/yolov4-pytorch/releases/download/v1.0/yolo4_voc_weights.pth) | VOC-Test07 | 416x416 | - | 89.0 | COCO-Train2017 | [yolo4_weights.pth](https://github.com/bubbliiiing/yolov4-pytorch/releases/download/v1.0/yolo4_weights.pth) | COCO-Val2017 | 416x416 | 46.1 | 70.2
## 实现的内容- [x] 主干特征提取网络:DarkNet53 => CSPDarkNet53- [x] 特征金字塔:SPP,PAN- [x] 训练用到的小技巧:Mosaic数据增强、Label Smoothing平滑、CIOU、学习率余弦退火衰减- [x] 激活函数:使用Mish激活函数- [ ] ……balabla
## 所需环境torch==1.2.0
## 注意事项代码中的yolo4_weights.pth是基于608x608的图片训练的,但是由于显存原因。我将代码中的图片大小修改成了512x512。有需要的可以修改回来。 代码中的默认anchors是基于608x608的图片的。 **注意不要使用中文标签,文件夹中不要有空格!** **在训练前需要务必在model_data下新建一个txt文档,文档中输入需要分的类,在train.py中将classes_path指向该文件**。 **加入letterbox_image的选项,关闭letterbox_image后网络的map得到大幅度提升。**## 小技巧的设置在train.py文件下: 1、mosaic参数可用于控制是否实现Mosaic数据增强。 2、Cosine_scheduler可用于控制是否使用学习率余弦退火衰减。 3、label_smoothing可用于控制是否Label Smoothing平滑。
## 文件下载训练所需的yolo4_weights.pth可在百度网盘中下载。 链接: https://pan.baidu.com/s/1WlDNPtGO1pwQbqwKx1gRZA 提取码: p4sc yolo4_voc_weights.pth是voc数据集的权重。
## 预测步骤### a、使用预训练权重1. 下载完库后解压,在百度网盘下载yolo4_weights.pth或者yolo4_voc_weights.pth,放入model_data,运行predict.py,输入 ```pythonimg/street.jpg```2. 利用video.py可进行摄像头检测。 ### b、使用自己训练的权重1. 按照训练步骤训练。 2. 在yolo.py文件里面,在如下部分修改model_path和classes_path使其对应训练好的文件;**model_path对应logs文件夹下面的权值文件,classes_path是model_path对应分的类**。 ```python_defaults = { "model_path": 'model_data/yolo4_weights.pth', "anchors_path": 'model_data/yolo_anchors.txt', "classes_path": 'model_data/coco_classes.txt', "model_image_size" : (416, 416, 3), "confidence": 0.5, "cuda": True}
```3. 运行predict.py,输入 ```pythonimg/street.jpg```4. 利用video.py可进行摄像头检测。
## 训练步骤1. 本文使用VOC格式进行训练。 2. 训练前将标签文件放在VOCdevkit文件夹下的VOC2007文件夹下的Annotation中。 3. 训练前将图片文件放在VOCdevkit文件夹下的VOC2007文件夹下的JPEGImages中。 4. 在训练前利用voc2yolo4.py文件生成对应的txt。 5. 再运行根目录下的voc_annotation.py,运行前需要将classes改成你自己的classes。**注意不要使用中文标签,文件夹中不要有空格!** ```pythonclasses = ["cruiseship", "ferryboat", "freightboat", "gondola", "inflatableboat", "kayak", "paperboat", "sailboat", "buoy"]```6. 此时会生成对应的2007_train.txt,每一行对应其**图片位置**及其**真实框的位置**。 7. **在训练前需要务必在model_data下新建一个txt文档,文档中输入需要分的类,在train.py中将classes_path指向该文件**,示例如下: ```pythonclasses_path = 'model_data/new_classes.txt' ```model_data/voc_classes.txt文件内容为: ```pythoncruiseshipferryboatfreightboatgondolainflatableboatkayakpaperboatsailboatbuoy```8. 运行train.py即可开始训练。
## 评估步骤不需要自己再建立get_dr_txt.py、get_gt_txt.py等文件。 1. 本文使用VOC格式进行评估。 2. 评估前将标签文件放在VOCdevkit文件夹下的VOC2007文件夹下的Annotation中。 3. 评估前将图片文件放在VOCdevkit文件夹下的VOC2007文件夹下的JPEGImages中。 4. 在评估前利用voc2yolo4.py文件生成对应的txt,评估用的txt为VOCdevkit/VOC2007/ImageSets/Main/test.txt,需要注意的是,如果整个VOC2007里面的数据集都是用于评估,那么直接将trainval_percent设置成0即可。 5. 在yolo.py文件里面,在如下部分修改model_path和classes_path使其对应训练好的文件;**model_path对应logs文件夹下面的权值文件,classes_path是model_path对应分的类**。 6. 运行get_dr_txt.py和get_gt_txt.py,在./input/detection-results和./input/ground-truth文件夹下生成对应的txt。 7. 运行get_map.py即可开始计算模型的mAP。
## mAP目标检测精度计算更新更新了get_gt_txt.py、get_dr_txt.py和get_map.py文件。 get_map文件克隆自https://github.com/Cartucho/mAP 具体mAP计算过程可参考:https://www.bilibili.com/video/BV1zE411u7Vw
## Referencehttps://github.com/qqwweee/keras-yolo3/ https://github.com/Cartucho/mAP https://github.com/Ma-Dan/keras-yolo4 1存放训练索引文件123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278abendstimmung-sunset-evening-sky-817715adventure-of-the-seas-cruise-ship-caribb-1218316africa-river-botswana-water-landscape-na-172697aida-driving-cruise-ship-sea-night-114556anchored-boats-ocean-nautical-sailboat-b-2047077antarctic-midnight-sun-kayak-polar-3474502archipelago-sailboat-mast-boats-434809architecture-buildings-city-cityscape-cl-1839097barges-canal-sunset-dusk-evening-719975battleship-pirate-ship-sailboat-warship--1688093beach-buoy-w-water-sea-ocean-1042883beach-ocean-summer-landscape-2920655beach-sea-ocean-sunset-boats-1208504boat-dawn-dusk-mast-ocean-sailboat-saili-1867174boat-ferry-black-forest-lake-123642boat-fog-marine-loneliness-nature-2333306boat-haze-ship-alone-marine-water-1819696boat-litoral-fishermen-beach-2646175boat-ocean-sea-water-sunset-3729971boat-sailboat-sail-sea-nature-17778boat-sailboat-sunset-navigation-boat-boa-1787261boat-sailing-boat-rest-calm-silent-1992137boat-sailing-canal-sail-ship-sun-sky-wat-2112210boat-sea-horizon-island-small-sail-summe-950359boat-sea-horizon-seascape-sailboat-2861565boat-sea-inflatable-boat-coast-2646811boat-summer-sea-ship-sail-travel-1634811boat-sunset-sea-sunbeam-sail-721937boats-marina-dock-water-harbor-sea-nauti-802067boats-sea-port-blue-water-summer-3638570boats-yacht-bay-ship-water-sea-2758960boats-yacht-ship-water-sea-marina-2758962body-of-water-sea-ocean-boat-3183509body-of-water-sea-sunset-sailboat-3179387boracay-sunset-philippines-beach-3031029buoy-scheepvaartmarkering-2714628buoy-sky-coastal-blue-travel-3568365buoy-sunset-ocean-water-sky-sea-nature-b-1094912buoy-water-keyhaven-united-states-of-ame-828029buoy-yellow-lake-winter-pond-ice-933324buoys-river-boats-stein-am-rhein-113406buoys-water-lake-safety-lifesaver-791339buoys-water-series-arrangement-3567037california-panorama-sea-ocean-2686349canoe-explore-travel-water-3595673canoe-water-nature-natural-outdoors-envi-49179canoeing-sport-water-sea-paddle-3600550career-paper-origami-leader-marina-marin-1738216caribbean-sunset-sailboat-palmtree-ocean-1504584caribbean-sunset-soap-bubble-ball-851218catamaran-sailing-boat-sailboat-3582541catamaran-sailing-sailboat-boat-199153cave-grotto-vacations-sardinia-memory-me-2077979channel-facade-water-building-city-3542819channel-gondola-venice-italy-water-3542800channel-venice-gondolas-italy-3547224sailing-sailboat-boat-travel-2542901sailing-ship-maritime-ship-sea-3212545sailing-ship-sailing-boat-calm-384677sailing-vessel-ship-sail-sea-ocean-shipp-1877540sailing-vessel-water-boat-afterglow-3405209sea-boat-horizon-sailboats-seascape-land-2056853sea-boat-sunset-ocean-water-yacht-sailbo-2141613sea-buoys-mist-fog-morning-card-605387sea-ferry-ocean-travel-boat-water-2820332sea-nature-sky-exotic-clouds-red-68052sea-ocean-boats-sailboats-beach-1357885sea-ocean-water-waves-nature-2561397sea-sailboat-sailing-sunset-2907762sea-sailboat-sunset-sailboat-sailboat-sa-2091933sea-sailing-boat-water-ship-sail-3726854sea-sailing-boat-water-ship-sail-3726855sea-sunset-ocean-bay-calm-quiet-406804sea-water-sunset-ocean-dawn-3302915ship-away-boat-vase-water-red-316558ship-away-boat-vase-water-red-paper-boat-315308ship-balance-stars-magic-fantasy-2804076ship-boat-cruise-liner-harbor-port-76670ship-boat-lake-sailing-boat-italy-952292ship-boat-marine-water-blue-sail-3755995ship-cruise-cruise-ship-vacations-2756487ship-cruise-ship-travel-sea-cruise-sky-t-1656608ship-ocean-sea-horizon-sunset-sunrise-na-918553ship-sailing-vessel-seafaring-2904969ship-sea-tourism-journey-water-2762527ship-sea-wave-romance-sails-1505929ship-tall-vessel-sea-sailing-647058ship-vacations-cruise-cruises-425064shipping-containers-wharf-wharves-harbou-1150062shipping-seafaring-ship-cruise-3649676ships-sailing-boat-boat-sailing-colorful-162075ships-tall-sailing-vessels-sea-642520ships-travel-sea-boat-cruise-3481704sky-dusk-darkness-evening-waters-3054732sky-nature-water-sea-outdoors-3332068smooth-shiny-water-bright-satin-3054850summer-buoy-water-late-summer-sweden-buo-916796sunrise-sunset-sun-sky-landscape-summer--2014053sunset-bay-sea-mood-abendstimmung-sky-na-660446sunset-boat-sea-sailboat-landscape-horiz-1747744sunset-dawn-sky-evening-panorama-3126715sunset-kayaking-lake-summer-3631742sunset-monolithic-part-of-the-waters-3122072sunset-mountains-kayak-oar-water-2831769sunset-nature-waters-dusk-dawn-3087790sunset-sailing-boat-boat-sea-ship-675847sunset-sailing-boat-lighthouse-sun-3759029sunset-sailing-boat-maldives-sea-90952sunset-sailing-ship-superstructure-1136147sunset-sea-clouds-key-west-324128sunset-sea-ocean-sailing-boat-ship-3140356sunset-sky-sailboats-lake-water-horizon--923930sunset-water-ocean-buoy-dusk-sky-orb-wav-1021058sunset-water-ocean-buoy-dusk-sky-reflect-802963sunset-water-sea-ocean-sailboat-3187225sunset-waters-sun-sea-reflection-3049610sydney-australia-sydney-opera-house-sydn-296027sydney-port-twilight-australia-2766957travel-cruise-cruise-line-water-ocean-va-967984trimaran-yacht-sailing-sailing-ship-2806616vacation-sailboat-vessel-sailboat-sailbo-1003660vacations-holidays-sea-lake-sailing-boat-2062299venice-gondola-evening-water-italy-2814768venice-gondola-fantasy-moon-mask-2070965venice-gondola-italy-2712852venice-gondola-sunset-italian-boat-venet-1546900venice-gondola-water-boat-canal-594615venice-gondolas-boats-water-sunset-dusk--924092venice-gondolas-italy-venezia-194835venice-gondolas-parking-port-dock-1559354venice-italy-architecture-sunset-1603273venice-italy-canal-landmark-city-3733156venice-italy-channel-gondolas-2923519venice-italy-gondola-boat-channel-2855270venice-italy-gondola-lagoon-romantic-was-1035632venice-italy-gondola-romantic-1035684venice-italy-water-architecture-building-2013436venice-st-mark-s-square-quarell-3448577venice-venice-carnival-mask-costume-pane-2100155vessel-loading-port-bay-cargo-2091454vessel-port-loading-ship-sea-transportat-2091798water-boats-buoys-shipping-river-113474water-buoys-shipping-river-113476water-kayak-holiday-rafting-3458877water-lake-boat-landscape-sun-fog-3398111water-ocean-sea-sailboat-sailing-2631744water-sailboat-serene-ocean-calm-14687water-sailboat-watercraft-travel-3288854waters-gold-golden-water-lake-3054738waters-gondola-boat-travel-sky-3247690waters-kayak-canoeing-paddle-water-2687791waters-lake-nature-reflection-3071288waters-sea-ship-boat-3176281waters-yacht-sea-sailing-boat-port-3084271yacht-boat-sea-sailboat-marine-yachting--1934226yacht-port-sailboat-784121yachts-sail-sea-water-boat-travel-nautic-2107526childhood-paper-boat-simple-paper-3559166costa-pacifica-kiel-baltic-sea-port-3650089cruise-caribbean-aida-sunset-vacations-s-778531cruise-north-america-passenger-ship-1267024cruise-ship-boat-sea-cruise-travel-189938cruise-ship-cruise-ship-twilight-108973cruise-ship-cruises-108974cruise-ship-dock-night-reflection-water--1156012cruise-ship-dock-vessel-boat-port-harbor-1146058cruise-ship-dock-vessel-boat-port-harbor-1396681cruise-ship-elbe-hamburg-ship-3526709cruise-ship-sea-vacations-port-holiday-c-1218305cruise-ship-serenade-of-the-seas-3484814cruise-ship-serenade-of-the-seas-3484854cruise-ship-shelf-princess-sunset-3547180cruise-ship-ship-cruise-vacations-sea-wa-788369cruise-ship-sunset-travel-sea-vacation-o-601527cruise-ship-transportation-2777910cruise-ship-tug-boat-ocean-sea-3714026cruise-ships-port-dock-cruising-339329cruising-ships-palm-trees-sunset-690568dawn-papierschiff-ship-sea-sunset-3361172des-moines-lake-kayak-iowa-des-2652691eat-food-ice-ice-cream-3691222emotions-nature-rest-sailing-boat-3658967emotions-travel-holidays-italy-3490223evening-lake-water-sailing-boat-3793471ferry-cruise-swimming-shipping-2865442ferry-sunset-puget-sound-fish-cruise-shi-958685fishing-buoy-sunset-water-orange-float-m-590688fog-landscape-nature-sun-2886563fog-landscape-nature-sun-2886564freight-tanker-vessel-boat-ship-oil-carg-863449gondola-channel-navigation-venetian-3247370greece-boats-sailboat-sea-ocean-2665945greece-sea-ocean-mountains-2693408greenland-boat-sailboat-ice-nature-ship--459793hawaii-sunset-sailboat-yellow-orange-oce-1421081iceland-cruise-ships-cruise-cruise-cruis-262739image-picture-photo-sea-ocean-sailing-sa-98475kayak-adventure-discover-water-row-846078kayak-kayakers-water-sports-paddle-rowin-59617kayak-nature-landscape-summer-3709004kayak-nature-water-summer-paddle-3678281kayak-rowing-relax-lake-haze-2858872kayak-sunset-water-nature-summer-3705662kayak-water-blue-leisure-activity-outdoo-963160kayak-water-swimming-kayaks-summer-3738459kayak-white-water-water-sports-courage-s-798009kayakers-kayak-paddle-rowing-water-canoe-3941kayaking-canoing-lakes-streams-creeks-wa-1149886kayaking-water-sport-activity-outdoors-b-1814426kayaks-beached-lake-yellowstone-1405994kayaks-lake-nature-landscape-river-1306723lake-balaton-nature-landscape-2640179lake-dock-sunset-serene-boats-pier-sailb-405657lake-kayak-fishing-summer-beautiful-land-404797lake-sunrise-morning-water-3617527lake-sunset-abendstimmung-evening-3452510lake-water-buoy-sunset-pond-1366314lake-water-sunshine-summer-canoe-kayak-t-690731landscape-solar-nature-sky-sunset-3730029landscape-twilight-marina-porto-3524381landscape-yacht-sunrise-reflection-1802340life-beauty-scene-transit-863028marina-boat-river-water-landscape-2192107mast-rigging-ship-sailboat-tall-ship-sun-983904mast-sailboat-sailing-clouds-cloudy-sky--925270morning-hours-sunrise-morning-sun-3585522nature-architecture-venice-gondola-3190721nature-landscape-lake-sea-sail-2032666nature-storm-kayak-rain-3391224norway-fjord-lake-water-reflections-crui-1945489nyc-sunset-sailboat-reflections-216106ocean-sunset-atlantic-ocean-barbados-sai-1549556ocean-water-nature-boat-horizon-3762815oil-tankers-supertankers-oil-tankers-336718paddle-kayak-canoe-explore-ocean-839814panorama-chiemsee-landscape-nature-2702126paper-boat-coloured-colored-2770974paper-boat-origami-2570218papierschiff-paper-ship-fold-635402photomontage-bay-water-sailing-boat-2404867photomontage-water-sea-sailing-boat-2399241pirate-ship-sea-moon-fantasy-ocean-sail--1719396port-loading-discharging-ship-cargo-tran-2090729port-ship-dsseldorf-media-harbour-2328702portland-oregon-river-canoe-portland-ore-1147712rainbow-moon-lake-sailing-boat-sail-peac-453101rhodes-lindos-sun-morning-sailboat-2739362river-water-leisure-kayak-paddling-sunse-691395river-yachts-sunrise-cork-crosshaven-ire-2057687sail-boat-ocean-black-and-hite-boat-2521055sail-horizon-orange-gloss-water-3760717sail-sailboat-vessel-yacht-charter-863082sail-sea-sailing-boat-boats-water-water--1238055sail-sunset-sea-water-ocean-3585674sailboat-boat-holidays-cruise-sea-3407027sailboat-boat-leisure-recreation-2693421sailboat-boat-ship-sail-sailing-2423484sailboat-ibiza-summer-sunset-2894220sailboat-ocean-harbor-bay-port-1623321sailboat-sailing-boat-sunset-427602sailboat-sailing-river-boat-sea-2431579sailboat-sailing-sky-clouds-sea-2530235sailboat-sky-boat-sail-travel-sail-boat--1031741sailboat-sunrise-yole-323164sailboat-sunset-sea-ocean-dark-3348374sailboat-water-dusk-vertical-summer-yach-673555sailboat-water-sunset-vacation-yacht-sai-414509sailboats-sailing-water-ocean-sea-yacht--1734842sailing-boat-lake-sailing-boat-596462sailing-boat-mastes-rigging-boat-sail-se-983933sailing-boat-ocean-open-water-sea-569336sailing-boat-sailing-yacht-3399014sailing-boat-sea-ship-water-2407303sailing-boat-shore-sky-sand-sea-sail-sum-1645394sailing-boat-sunset-summer-nature-3758189sailing-boats-carboats-calm-quiet-384671sailing-boats-sea-ocean-leisure-sports-s-601541sailing-racing-regatta-j-105-105-245596912345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178sailboat-sail-yacht-water-sea-3188611sailboat-sailing-boat-sailing-wave-296781sailboat-sailing-boat-sea-boat-1149519sailboat-sailing-boat-ship-sea-471538sailboat-sailing-boat-ship-waves-ocean-b-297740sailboat-sailing-navigation-boat-sailing-1346269sailboat-sailing-sea-ocean-water-sail-bo-995226sailboat-sailing-ship-boat-marina-travel-39237sailboat-sails-rigging-marin-mats-2347366sailboat-sails-sky-sunshine-sunny-sailbo-691452sailboat-san-francisco-412120sailboat-schooner-sea-ship-vessel-2253sailboat-sea-boat-sail-vessel-nautical-s-310753sailboat-sea-boat-sailing-summer-3417883sailboat-sea-boats-browse-387638sailboat-sea-ship-sky-blue-travel-553992sailboat-sea-ship-sky-blue-travel-553993sailboat-sea-water-sail-ship-3080332sailboat-ship-sailing-greenland-boat-shi-459794sailboat-ship-sailing-pirate-ocean-sail--37510sailboat-ship-sea-travel-nautical-yacht--174469sailboat-two-master-old-ship-flags-306010sailboat-water-stockholm-ship-sweden-hos-610623sailboat-wave-yacht-fast-colorful-305716sailboat-waves-sails-red-sea-water-ocean-304064sailboat-yacht-sea-holidays-water-sailbo-2143219sailboat-yacht-sea-sail-rope-3329021sailboat-yacht-sea-water-sailboats-saili-2133663sailboat-yacht-ship-maritime-boat-3091693sailboats-marina-harbor-port-bay-reflect-1149078sailboats-moored-jetty-water-2233382sailboats-race-competition-ocean-1531877sailboats-race-competition-sail-671178sailboats-race-yachts-yacht-racing-1375064sailboats-racing-competition-male-men-ve-696089sailing-boat-boat-coast-sea-nature-3551316sailing-boat-boat-sail-sea-ocean-309781sailing-boat-boat-sailing-wind-sails-shi-295250sailing-boat-boat-seagull-water-sea-ship-2172343sailing-boat-boat-ship-sea-sky-444077sailing-boat-boat-yacht-sailing-black-si-163614sailing-boat-coast-sea-water-sail-2550147sailing-boat-crafts-trim-sailboat-993901sailing-boat-crew-man-woman-3650170sailing-boat-gulls-north-sea-249992sailing-boat-herrenchiemsee-castle-3708861sailing-boat-lake-constance-ship-idyll-w-600835sailing-boat-lake-sea-sail-ocean-2293832sailing-boat-lonely-blue-mood-337712sailing-boat-plant-water-sea-sand-beach--1617626sailing-boat-sail-sailing-boat-yacht-auc-50533sailing-boat-sail-sailing-sport-water-se-165313sailing-boat-sail-vacations-1593613sailing-boat-sailing-sailboat-water-406933sailing-boat-sailing-vessel-ship-3399011sailing-boat-sailing-vessel-ship-boat-ma-1473281sailing-boat-sailing-yacht-3399002sailing-boat-ship-boat-water-2820638sailing-boat-ship-vessel-nautical-435447sailing-boat-ship-yacht-sail-3128426sailing-boat-stem-sail-water-travel-yach-605504sailing-boat-water-lake-haze-931515sailing-boat-yacht-sail-sea-waters-3128427sailing-boat-yacht-sailboat-water-sea-oc-622541sailing-boats-boats-fog-mist-water-597916sailing-sailboat-navy-ship-ocean-37727sailing-sailboat-sea-summer-sport-sail-s-1686721sailing-sailboat-transportation-boat-nav-26602sailing-sailboat-water-ocean-yacht-wind--2040826sailing-sailboat-windy-lake-water-coast--691802sailing-sailing-boat-catboat-99229sailing-sailing-boat-catboat-sailboat-sa-99230sailing-sea-saint-tropez-sailing-boat-bo-1123260sailing-ship-boat-pirate-sea-311318sailing-ship-cruise-sea-wind-wave-456209sailing-ship-cruise-vacation-954799sailing-ship-mast-boat-sea-2663381sailing-ship-mast-boat-sea-2864762sailing-ship-ocean-sea-water-37723sailing-ship-pirate-ship-ship-pirates-sa-2028575sailing-ship-rushing-water-river-675214sailing-ship-sail-ship-sailing-147005sailing-ship-sailboat-ocean-sailing-148712sailing-ship-sailboat-ocean-sailing-148715sailing-ship-ship-sailing-vessel-sea-boa-312417sailing-ship-transportation-old-silhouet-294269sailing-ship-vessel-boat-sea-659758sailing-ship-water-ocean-sea-37724sailing-ships-lake-constance-alpine-1418069sailing-vessel-sail-sea-3672sailing-vessel-sail-sea-3673sailing-vessel-sail-side-ship-3063758sailing-vessel-sailing-boat-boat-mast-sh-1473316sailing-vessel-sailing-boat-sail-1473282sailing-vessel-water-ship-yacht-382407sailing-yacht-antigua-caribbean-boat-shi-171900sailing-yacht-sail-sailing-boat-3579588sailors-rigid-hull-inflatable-boat-1088385san-francisco-boats-ferry-golden-959499santorini-greek-island-cyclades-caldera--1788636scenery-tropical-boat-sailing-boat-saili-1179905scheepvaartmarkering-marking-2715012scheepvaartmarkering-marking-2715014scheepvaartmarkering-seagull-marking-2715015schooner-ocean-sea-boat-sailboat-377090schooner-vintage-sailing-sail-ship-boat--487800schooner-wooden-ship-sailboat-vessel-sea-754872sea-boats-ocean-water-sailboat-3544557sea-buoy-bird-simple-design-2300144sea-buoy-solitary-yellow-buoy-buoy-buoy--788866sea-costa-sky-holiday-water-blue-2834297sea-cruise-travel-cruise-ship-seafaring--1281360sea-cruise-travel-cruise-ship-seafaring--1281361sea-kayaking-father-and-son-adventure-fa-253525sea-lion-san-pedro-harbor-harbor-2465560sea-mediterranean-malta-blue-water-islan-259823sea-ocean-sailboat-nature-sailing-162684sea-ocean-sailboat-sailing-leisure-2693404sea-ocean-water-nature-coast-coastline-b-67912sea-ocean-wide-blue-water-sailing-boat-l-1090586sea-sailboat-boat-mediterranean-952215sea-sailboat-water-sail-ocean-3301733sea-sailboats-boats-regatta-cruises-sail-874710sea-sailing-boat-clouds-mood-coast-381542sea-sailing-vessel-boat-cannes-cte-d----2169263sea-shelter-boat-water-coast-3141386sea-ship-boat-nautical-travel-3314718sea-ship-boat-nautical-travel-3397526sea-ship-boat-ships-boats-on-lake-183427sea-sky-beach-sand-water-clouds-rocks-st-1283188sea-the-ship-sky-cruise-tourism-2913388-copysea-the-ship-sky-cruise-tourism-2913388sea-waters-coast-travel-port-3104494seagull-bird-fowl-sky-clouds-94926seaside-summer-chairs-flowers-781946ship-ahoy-ozeanriese-screw-shaft-3403807ship-away-boat-vase-water-red-315309ship-away-boat-vase-water-red-paper-boat-316557ship-away-boat-water-red-315312ship-barcelona-river-sailboat-barcelona--756570ship-boat-cruise-vacation-ocean-vessel-t-29697ship-boat-nautical-sail-wind-travel-mari-311301ship-boat-pirate-clipper-sail-40209ship-boat-pirate-ocean-viking-sail-longb-32253ship-boat-sail-pirate-travel-40009ship-boat-sailboat-travel-nautical-yacht-37589ship-boat-sea-water-summer-travel-527528ship-boat-transport-nautical-marine-vess-145400ship-boat-water-sea-port-aida-1578526ship-bug-create-dew-cruise-ship-3554711ship-bug-cruiser-cruise-ocean-3663ship-cruise-cruise-ship-water-2462241ship-cruise-liner-cruiser-cruise-ship-fe-158287ship-cruise-maritime-1083559ship-cruise-ship-cruise-ship-travel-3579589ship-cruise-ship-cruise-vacations-3480720ship-cruise-ship-cruise-vacations-3480724ship-cruise-ship-ocean-liners-221474ship-cruise-ship-sea-port-water-vacation-892750ship-cruise-travel-vacation-passenger-to-401349ship-cruise-vacation-vessel-cruise-cruis-1546194ship-cruise-vessel-ocean-vacation-3737809ship-cruiser-cruise-water-3649420ship-cruises-cruise-ship-seafaring-3455779ship-cruises-cruise-ship-vacations-3455806ship-cutter-tall-vessel-sea-759938ship-elbe-hamburg-port-port-city-3526712ship-ferry-cruise-cruise-ship-962681ship-ferry-lisbon-atlantic-1395941ship-frachtschiff-freighter-water-shippi-2204981ship-frachtschiff-freighter-water-shippi-2205504ship-hanse-sail-baltic-sea-summer-2907716ship-lake-constance-port-shipping-2778269ship-lake-japan-sailboat-hakone-3587953ship-liner-boat-cruise-ship-ocean-sea-wa-316885ship-mouth-aida-cruise-ship-cruise-192351ship-ms-orchestra-ibiza-spain-138962ship-passenger-ship-cruise-ship-norway-f-392110ship-pirate-pirate-ship-sail-sea-1359572ship-port-iceland-boat-maritime-3738230ship-port-ships-barcelona-spain-city-sea-115420ship-port-water-technology-ferry-86071ship-rhine-rhine-cruises-shipping-3779205ship-sail-sailing-sails-sky-102246ship-sail-sailing-vessel-2094307ship-sailboat-sailing-nautical-vessel-ya-32252ship-sailing-boat-frigate-sea-ship-ship--2168927ship-sailing-boat-paper-water-2531237ship-sailing-boat-sail-boat-boat-2502000ship-sailing-ocean-sea-travel-37713ship-sailing-ocean-vessel-sailboat-145552ship-sea-my-ship-cruise-ship-3581749ship-shipping-boat-boat-trip-418895ship-shipping-transport-maritime-140255ship-steamer-boat-river-water-3616996ship-tall-vessel-sea-sailing-701579ship-tall-vessel-sea-sailing-701595ship-tall-vessel-sea-sailing-701598ship-tallship-tall-ship-sea-sail-2523650ship-tanker-cargo-sea-2573453ship-transportation-sailing-maritime-car-145510ship-travel-cruise-ship-vacations-2817540ship-water-america-cruise-ship-travel-bo-2162299ship-yacht-boat-sea-ocean-travel-2756152shipping-cruise-ship-cruises-3526982shipping-ship-cruise-vacations-3649673shipping-vacations-travel-leisure-3649677ships-kiel-water-sky-blue-209632ships-queen-mary-cruise-ship-hamburg-riv-2146989ships-tall-vessel-sea-sailing-701596ships-vessels-military-navy-802887sidney-opera-port-australia-city-234713sitting-duck-looks-kayak-swim-3601355sluice-system-lock-3140198south-sea-pacific-cruise-3597151south-sea-pacific-cruise-3597153sport-summer-board-leisure-sea-sports-wa-2130230sport-vacations-masuria-kayak-2580336sport-water-sports-kayak-canoeing-473878sport-water-sports-kayak-canoeing-473879sport-water-sports-kayak-kayak-kayak-kay-542429st-mark-s-square-gondola-venice-920863stanley-park-fall-autumn-vancouver-3686935steinbach-attersee-bergsee-austria-3721706storm-pirate-sea-marine-boat-sky-3254676summer-beach-stone-trees-azure-blue-sea--811246summer-sailing-sailboat-greece-sailboat--1283743sydney-australia-circular-quay-321513sydney-australia-skyline-skyscrapers-bui-86954sydney-harbor-cruise-ship-cityscape-sea--577008sydney-harbour-manly-ferry-boat-329028the-last-man-standing-the-gondolier-3779587three-masted-sailing-ship-christopher-co-1280890tourists-canoe-travel-nature-adventure-l-2129565tourists-canoe-travel-nature-adventure-l-2129575transport-france-sete-boat-3276174transport-ship-queen-mary-2-2670125transport-ship-queen-mary-2-2670131transport-ship-queen-mary-2-2670235transport-system-ship-waters-human-3109226travel-vacations-summer-tourism-3571077travel-vacations-summer-tourism-3571078travel-vacations-venice-gondolas-canal-g-2058242travel-venice-italy-gondola-218846travel-waters-sea-ship-cruise-ship-3196458two-cruise-ships-bahamas-2413470vacations-italy-garda-sailing-boat-471169vacations-travel-holidays-summer-3585534vancouver-canada-port-cruise-ship-pier-p-2106888venetian-canal-gondola-boat-water-3207547venetian-las-vegas-gondola-canal-archite-562759venetian-las-vegas-gondola-canal-archite-562762venetian-las-vegas-gondola-christmas-can-562746act-active-activity-adventure-boat-2672066act-active-activity-adventure-boat-2672090action-active-boat-danger-excitement-kay-16891action-active-boat-danger-excitement-kay-16892action-active-boat-two-excitement-kayak--20459activity-adventure-boat-cruise-3602690adventure-boat-canoe-fun-kayak-lake-outd-1867074adventure-clear-water-exercise-1836601adventure-water-boat-canoeing-call-2674523aida-port-palma-mallorca-spanish-3116976aida-ship-cruise-vacations-port-802359aida-ship-driving-cruise-ship-sea-144796aida-ship-driving-cruise-ship-sea-51186aida-sol-cruise-ship-port-ship-652338aidaluna-warnemnde-germany-cruise-ship--1435536alaska-ocean-warning-light-sea-2574393alaska-fjord-ship-cruise-landscape-2666217albin-express-sailboat-regatta-top-mark--971506alpine-lake-beach-tops-the-alps-3565476america-boat-flag-ocean-sailboat-sea-shi-1298037anchor-warp-rope-buoy-beach-2881563annapolis-maryland-bay-harbor-water-sail-89803apostle-island-ferry-3524075architecture-building-river-truss-3686707astor-cruise-ship-seafaring-cruise-3428016astronira-sea-sailing-ship-gouache-paint-213674atoll-barrier-beach-blue-canoeing-2674441auckland-new-zealand-dawn-princess-2369525austin-river-kayak-texas-town-lake-citys-2087145aveiro-gondolas-river-2725323bahrain-sky-clouds-sailboats-sea-ocean-w-89828balmoral-cruise-ship-cruise-ship-shippin-574704bamberg-gondola-small-venice-243510beach-beautiful-blue-boat-cruise-3741909beach-mar-ocean-sky-umbrella-2014143beach-seacoast-shore-kayak-sea-1244720beacon-lighthouse-coast-navigation-39232beautiful-landscape-cruise-boat-sailing--1966730bilbao-port-ship-cruise-1216612bird-s-eye-view-yacht-sea-sailboats-wate-2133661blue-boat-buoy-floating-2834157blue-boat-freedom-horizon-ocean-2878blue-boat-freedom-horizon-ocean-84588blue-buoy-float-navigation-ocean-20511boat-beach-kayak-landscape-summer-3754830boat-body-of-water-transport-sea-3079680boat-coast-island-nature-ocean-rocks-sai-1836542boat-cruise-liner-ocean-sea-ship-transpo-1296612boat-cruise-ship-celebrity-top-106105boat-cruise-ship-travel-stop-3714690boat-cute-minimal-origami-paper-1295836boat-docked-vessel-harbor-ocean-pier-sea-983899boat-ferry-departure-crossing-sea-2733061boat-ferry-logo-ship-transport-157680boat-ferry-sea-water-transport-1629523boat-fishing-ocean-sailboat-sailing-sea--1298033boat-fold-folded-paper-ship-boat-boat-bo-1294269boat-from-above-top-view-hai-2435056boat-front-rope-sail-marine-sky-3646499boat-gondola-grand-canal-june-summer-ita-834501boat-holiday-water-direct-sailboat-3620792boat-inflatable-boat-sea-motor-1085738boat-inflatable-rubber-activity-308891boat-kayak-inuit-transportation-kayaking-145550boat-kayak-kayaks-nature-water-3766640boat-kayak-sea-calm-beach-3698590boat-marine-maritime-ocean-sailboat-sea--2028001boat-marine-ocean-sailboat-sea-ship-silh-1297042boat-meet-friends-fight-lego-3617330boat-oars-man-dog-water-paddle-calm-summ-959079boat-ocean-recreation-sailboat-sea-trans-2028042boat-paper-folded-ship-water-153358boat-paper-origami-craft-35129boat-port-reflections-water-1397551boat-river-girl-rowing-sports-charging-t-1556062boat-sail-boat-sailing-boat-sailing-sea--304361boat-sail-float-paper-newspaper-2770960boat-sail-harbor-ship-sea-sailing-water--1962828boat-sail-port-vacations-3007853boat-sail-sailboat-schooner-sea-ship-oce-159368boat-sail-sailboat-sea-ship-water-1867124boat-sail-sailing-sea-sail-boat-950361boat-sailboat-bar-navigation-boat-boat-b-808324boat-sailboat-ocean-sailing-port-3240220boat-sailboat-lake-water-nature-sail-sai-933055boat-sailboat-pontoon-sailing-2632503boat-sailboat-rhne-river-browse-france--1949685boat-sailboat-sailing-boat-boat-boat-boa-1297487boat-sailboat-sailing-ship-2027331boat-sailboat-sailing-ship-ocean-water-w-145419boat-sailboat-sea-ocean-wind-sailing-sai-1161380boat-sailboat-sea-sailing-159095boat-sailboat-ship-yacht-sail-2493190boat-sailboat-wind-marine-water-3620840boat-sailboat-wood-port-953975boat-sailing-boat-mast-sail-165310boat-sailing-flag-circle-transportation--48647boat-sailing-sail-ship-nautical-sea-wate-1293071boat-ship-tradition-sea-sailing-220070boat-sign-ship-sign-ferry-sign-ship-boat-36951boat-switzerland-bergsee-tourism-blue-fe-1513948boat-vessel-ship-sailboat-pirate-ship-cr-2019184boat-water-bird-beach-sand-2840152boat-water-river-sea-ocean-blue-3624704boat-waters-lake-travel-sea-river-3168511boating-extreme-sport-inflatable-boat-un-1259608boating-extreme-sport-inflatable-boat-un-1259609boats-canoeing-paddle-kayak-1350876boats-lake-regatta-landscape-3635880boats-sail-sea-mediterranean-1597885boats-sailboats-boat-sailing-boat-2351182boats-sailing-boat-sailing-boat-3751139boats-water-twilight-singapore-travel-sh-200681body-of-water-pool-travel-hotel-3267869body-of-water-sea-ocean-nature-3137509bojka-buoy-water-bojka-rescue-882679bosphorus-istanbul-sailboat-3556995boston-massachusetts-city-urban-skyline--1775870bottle-seashore-sailing-boat-sail-sky-cl-1470589bridge-ferry-captain-travel-water-2648720bridge-of-sighs-venice-gondola-3562574bridge-river-ship-river-navigation-3694245bridges-canal-customers-gondola-gondolie-1294967budapest-hungary-parliament-building-pal-632851bug-boat-paddle-boat-water-sports-3731415buoy-beach-sea-buoys-scenic-242727buoy-beacon-sea-beach-sand-2266571buoy-beacon-water-blue-yellow-1661196buoy-buoy-marker-ocean-sea-sea-buoy-tide-72044buoy-float-floating-device-lifebuoy-2723buoy-lobster-wood-fence-traps-float-equi-142099buoy-lverstopt-river-340716buoy-marker-ocean-sea-safety-3584304buoy-navigation-marine-maritime-412276buoy-perazzo-water-lake-nature-3542177buoy-sea-water-ocean-marine-float-2673666buoy-seagull-water-nature-birds-3764298buoy-surface-marker-buoy-floater-347847buoy-water-international-ocean-sea-39227buoy-water-signs-symbols-39257buoy-waters-marker-sea-ocean-14553buoy-yellow-coast-beach-necklace-2341844buoys-daymark-maritime-ship-coast-83926buoys-maritime-shipping-colorful-408287businessman-empire-wealth-giant-1156879bute-ferry-port-scotland-argyll-sea-scot-1010612cadiz-andalusia-spain-travel-sky-3197928california-sea-lions-buoy-harbor-139007canal-barge-gondola-italy-venice-2672072canal-grande-venice-waterfront-italy-can-337987canal-venice-italy-architecture-water-bo-839285canoe-boat-paddling-water-summer-lake-sp-480465canoe-kayak-athlete-activity-2895795canoe-kayak-athlete-effort-activity-2895791canoe-kayak-boat-water-paddle-3643088canoe-kayak-boat-water-paddle-3643096canoe-kayak-boat-water-paddle-3643113canoe-kayak-boat-water-paddle-3643120canoe-kayak-dam-obstacle-canoe-canoe-kay-1763394canoe-kayak-paddle-lake-water-2618417canoe-kayak-river-sport-rafting-river-ra-158768canoe-kayak-rowing-kayaking-canoeing-pad-1263169canoe-kayak-sport-adventure-2789786canoe-kayak-sport-kayaking-canoeing-2384643canoe-kayak-sport-kayaking-canoeing-2385203canoe-kayak-sport-kayaking-canoeing-2385207canoe-kayak-sport-water-sport-1405961canoe-kayak-water-sport-water-water-spor-2246464canoe-lake-adventure-kayak-canoeing-outd-2179196canoe-lake-forest-nature-water-canoeing--918969canoe-nature-water-summer-boat-49191canoe-oar-water-river-gard-france-3638441canoe-oar-water-river-gard-france-3638455canoe-portage-man-walking-boat-heavy-kay-158750canoe-sign-symbol-icon-boat-water-activi-309430canoe-water-boat-sport-kayak-river-canoe-49174kayak-lake-water-mountains-alaska-nature-218196kayak-lake-water-sunshine-summer-2619870kayak-man-active-boat-paddle-kayaking-sp-158581kayak-observation-tower-river-mangrove-n-1523731kayak-ocean-atlantic-grey-blue-2889458kayak-ocean-british-columbia-209903kayak-ocean-rafting-canoe-boat-adventure-282329kayak-on-the-water-lake-nature-3698118kayak-paddle-boat-outdoors-lake-454355kayak-paddle-white-water-sport-water-spo-809697kayak-paddling-kayaking-river-40749kayak-paddling-water-lake-summer-nature--437418kayak-para-boat-water-lake-kayaks-3570317kayak-person-water-sport-activity-3793713kayak-racing-helmet-sport-olympics-305323kayak-rafting-canoe-boat-adventure-282068kayak-rafting-canoe-boat-adventure-paddl-282312kayak-rafting-canoe-man-boat-282330kayak-rafting-canoe-man-boat-adventure-k-282003kayak-river-child-canoe-water-kayaking-p-929918kayak-river-child-canoe-water-kayaking-p-929919kayak-river-man-person-paddler-paddling--158582kayak-river-nature-kayak-kayak-kayak-kay-1596818kayak-river-sport-water-rafting-2380592kayak-river-water-boat-man-2996319kayak-sea-cte-d---azur-sea-kayak-blue-w-1714591kayak-sea-man-person-paddling-hand-hello-158583kayak-sea-sport-beach-hot-summer-14759kayak-sea-water-sport-kayaking-2638305kayak-sea-water-sport-kayaking-2707226kayak-summer-natural-outdoor-beach-3621398kayak-water-outdoor-paddle-3621399kayak-water-sports-for-two-interaction-s-798015kayak-white-water-water-sports-798016kayak-white-water-water-sports-man-795935kayak-white-water-water-sports-paddle-he-798014kayak-whitewater-action-helmet-936191kayak-whitewater-action-helmet-extreme-a-936190kayak-yellow-canoeing-sea-salento-197945kayaker-kayak-kayaking-ocean-sea-75698kayakers-kayak-paddle-rowing-water-3940kayaking-extreme-kayak-water-sport-adven-1122520kayaking-girl-leisure-sport-outdoor-wate-918464kayaking-kayak-activity-boat-paddle-summ-796790kayaking-kayak-extreme-sports-2684812kayaking-kayaker-kayak-water-sports-wate-569282kayaking-kayaker-sport-kayak-competition-662858kayaking-kayakers-sport-kayak-recreation-2071920kayaking-kayakers-sport-kayaks-3734062kayaking-paddling-vancouver-lake-2615279kayaking-water-blue-sport-summer-2827697kayaking-water-sport-activity-leisure-li-1814437kayaking-water-sport-adventure-wildernes-850449kayaking-water-sport-adventure-wildernes-850455kayaks-beach-shore-lake-water-584692kayaks-boat-color-sport-dock-kayaks-kaya-908859kayaks-kayaking-water-sport-summer-2728181kayaks-lake-water-nature-canoe-boat-spor-16944kayaks-pattern-boats-colorful-180543kayaks-rafting-canoes-boats-281819kayaks-sea-tourism-holiday-summer-2927322kazimierz-dolny-winter-snow-186704koningsdam-holland-america-cruise-2721202krutynia-canoe-trip-river-2819166kurort-rathen-saxon-switzerland-3529656kurort-rathen-saxon-switzerland-3529658lagoon-houses-gondolas-176020lake-alpine-lake-kayak-bergsee-3682633lake-autumn-nature-trees-landscape-1798498lake-balaton-balatonalmdi-port-3716700lake-boat-summer-idyll-water-sky-3617526lake-boat-water-sailing-boat-sailing-ves-1915846lake-bodensee-cruise-ferry-3287535lake-bridge-kayak-sunset-1374093lake-canoe-kayak-canoeing-kayaking-2783302lake-canoeing-water-nature-2872156lake-carmi-vermont-rural-kayaks-3525386lake-constance-sailing-boat-boat-621700lake-garda-italy-beach-kayaks-981371lake-geneva-montreux-switzerland-933465lake-geneva-montreux-switzerland-933466lake-holy-cross-verdon-france-2852847lake-island-water-reflection-sky-2787631lake-kayak-clouds-mirroring-boje-3759770lake-kayak-paddle-water-sports-2687100lake-kayak-water-kayaking-summer-2787690lake-mcdonald-landscape-kayaking-mountai-1583654lake-mcdonald-landscape-kayaking-mountai-1583657lake-on-the-water-far-idyllic-3698212lake-sailing-vessel-wind-1618382lake-sils-graubnden-switzerland-3209179lake-summer-kayaks-water-landscape-3687134lake-tahoe-california-kayak-water-2245241lake-water-kayaks-canoes-outdoors-926635landing-cruise-ship-mediterranean-nice-s-1441457lastovo-croatia-ship-sea-jadran-sailing--974826leisure-canoeing-kayak-paddle-368487light-bulb-sea-sailing-vessel-1417742lighthouse-boat-sail-boat-sea-ocean-wate-937726lighthouse-cruise-ship-belize-3288111lighthouse-light-house-sea-nautical-wate-746278lisbon-cruise-summer-travel-ship-tourism-2165735maine-buoy-boat-buoys-sea-holiday-3177128mallorca-palma-de-mallorca-marina-3259154man-kayak-sea-sport-beach-14784manaus-brazil-south-america-2549664manipulation-photoshop-kitchen-faucet-wa-1875815map-int-international-sphere-39228marina-boats-sailboat-reflection-3648612marina-stern-buoys-sailing-ships-988537mariner-of-the-seas-cruise-ship-112001massachusetts-landscape-charles-93265mast-boat-sailboat-sky-486598mats-rope-ladders-sailboat-1273182mekong-river-ferry-river-abendstimmung-b-1349607men-kayak-rafting-canoe-boat-adventure-w-282255minion-giant-funny-cruise-ship-1156867model-boat-sailboat-yacht-sail-sailing-s-1246639model-ship-cruise-ship-shipyard-2424340montral-chteauguay-water-kayak-sport-w-1427172ms-helgoland-ferry-boat-helgoland-1969408my-ship-cruise-caribbean-3688195my-ship-cruise-cruise-ship-sea-ocean-shi-1576531my-ship-cruise-porthole-cruise-ship-crui-1538726nabada-inject-water-removal-ulm-189486new-york-skyline-manhattan-hudson-540807new-zealand-queenstown-fjord-2492599new-zealand-queenstown-fjord-2492601norway-eidfjord-landscape-water-789345norway-post-ship-hurtigruten-ship-3587449ocean-cruise-tourist-travel-tourism-3063024ocean-kayak-kayaking-summer-water-2673555ocean-landscape-water-nature-3762814ocean-sail-sailboat-sea-2027651ocean-sailboat-sailing-sky-blue-marine-w-993075ocean-sailboat-sea-horizon-sky-blue-wate-802127ocean-starry-sky-milky-way-rest-3605547on-the-high-seas-horizon-1546101on-the-water-lake-ferry-sailboat-3709704origami-boat-fold-folding-paper-151997origami-paper-boat-paper-ship-paper-155166origami-paper-sailing-sailboat-1067673oslo-aida-norway-port-oslofjord-963483oslo-norway-port-oslofjord-city-908528outdoor-healing-tranquil-lake-kayak-peac-2206196paddle-canoeing-kayak-canadians-canadian-812266paddle-canoeing-kayak-leisure-2611126paddle-kayak-canoeing-explore-3729596paddle-kayak-kayaking-water-canoe-3364763painting-watercolor-figure-ship-3347301panoramic-new-york-city-hudson-river-2611522papenburg-germany-meyer-werft-ship-3021757paper-boat-newspaper-origami-2770961paper-boat-newspaper-tinker-paper-boat-p-2101247paper-boat-origami-float-childhood-toy-k-1644988paper-boat-paper-folded-heart-2287575paper-boat-paper-folded-plus-minus-2287555paper-boat-toy-folded-crafts-papers-play-34131paper-boat-water-afloat-on-the-street-fl-2270314paper-rowboat-boat-water-blue-3290362paper-ship-boat-shipping-craft-2389326paper-toy-boat-kids-folding-float-40021paperboat-water-voyage-paper-boat-toy-fl-1014962papierschiff-water-boat-ship-fold-origam-389016para-senior-people-male-sailboat-3337426pareo-origami-boat-boat-paper-2522811pareo-origami-boat-boat-paper-2522836pareo-origami-boat-boat-paper-2522837passenger-ship-ship-cruise-cruise-ship-k-542378passenger-transport-167873passengers-ferry-boat-167876patio-veranda-chairs-rattan-furniture-se-761862pier-yacht-sea-coast-boat-sky-3790265pirate-pirate-village-swashbuckler-villa-2144557pirate-pirate-village-swashbuckler-villa-2144562pirate-ship-black-pearl-sailboat-2476398pirate-ship-black-pearl-sailboat-2758026pirate-ship-ship-pirates-sail-vessel-sai-2028572pirate-ship-ship-pirates-sail-vessel-sai-2028574pirates-sailing-ship-frigate-ship-fog-vo-587988port-boat-yacht-marina-sea-water-2099340port-sailing-boat-boats-water-2477512port-ship-boat-marina-yacht-3007852port-yachts-the-coast-boat-3500081post-impressionist-post-impressionism-fi-1428129post-ship-nordkapp-cruise-ship-650063purple-ship-sailing-ship-3054804queen-mary-ii-cruise-ship-ship-425066rapid-water-fall-river-wild-white-splash-315321recreation-travel-attraction-tourist-spo-43881regatta-fiumanka-race-sailboat-sailing-y-1049741regatta-sailboats-yachts-water-lake-port-2133668regatta-sailing-boat-race-sailing-boat-s-350479relaxing-lazy-afternoon-girl-2813241resort-kayak-lagoon-tropical-water-beach-911968rhine-ship-bridge-water-river-3766100rialto-bridge-canal-grande-gondola-2941322rialto-bridge-canal-water-venice-999962rialto-bridge-gondoliers-rialto-457721rialto-venice-gondola-rialto-bridge-vene-813584ribbed-floats-buoys-2835795rigging-sailboat-masts-sails-801720rigging-sailing-ship-vessel-497973rigging-tall-ship-sails-ship-boat-mast-v-918920rigid-hull-boat-inflatable-speed-crew-wa-1025344river-cruise-russia-cruise-cruise-ship-l-538839river-ferry-water-ship-boat-1615351river-kayak-kayaking-paddling-summer-sun-2206278river-nile-egypt-sailboat-dhow-felucca-s-378495rocky-coast-landscape-pirate-ship-2288237sail-boat-anchoring-calm-seascape-690217sail-boat-beach-sand-yellow-white-2644519sail-boat-boat-sailing-sea-sail-991323sail-boat-flag-blue-sail-boat-370164sail-boat-ocean-sky-race-boat-sea-2521051sail-boat-ship-ocean-sea-sailing-32256sail-boat-ship-storm-rain-508183sail-boat-southwest-florida-gulf-of-mexi-1192976sail-boat-water-reflection-sails-35270sail-boats-caribbean-boat-sea-sail-1330421sail-boats-marina-harbor-port-677581sail-sailing-boat-boat-sea-ship-498498sail-sailing-boat-sport-team-78389sail-sailing-boat-wind-water-3729607sail-sailing-vessel-traditionally-3552152sail-ship-sailing-nautical-2104516sailboat-blue-boat-sailing-sailing-boat--154877sailboat-boat-blue-yacht-sky-3668503sailboat-boat-sail-sailing-silhouette-si-153812sailboat-boat-sailing-yacht-islands-croa-950351sailboat-boat-sailing-yacht-islands-croa-950352sailboat-boat-sea-sail-ship-37725sailboat-boat-sea-sailing-ship-3635101sailboat-boat-ship-hudson-river-3745621sailboat-boat-ship-sails-yacht-32257sailboat-boat-yacht-sail-water-sea-saili-158062sailboat-children-playing-kid-girl-saili-23801sailboat-former-brest-2454043sailboat-frigate-hermione-3113535sailboat-go-wind-marine-wave-3622231sailboat-go-wind-marine-wave-3622248sailboat-lake-water-926172sailboat-marseille-mediterranean-sea-sai-543046sailboat-marseille-port-944747sailboat-mats-flags-climbing-boy-598365sailboat-ocean-bahamas-abacos-sea-travel-823176sailboat-ocean-sea-water-1197304sailboat-ocean-sea-water-transportation--1197305sailboat-ocean-sun-blue-sail-33236sailboat-old-rig-regatta-sailboat-sailbo-543064sailboat-outline-white-sport-marine-naut-310339sailboat-red-sail-beach-sand-sun-navigat-2159616sailboat-river-sailing-florida-usa-3601125sailboat-sail-boat-water-navy-37726sailboat-sail-norway-fjord-ship-2322972sailboat-sail-sailing-boat-river-water-s-1572874canoe-water-boat-sport-paddle-49175canoe-water-oar-kayak-boat-3091709canoeing-kayak-ljubljana-slovenia-river--2149703canoeing-paddle-channel-2574922canoeing-paddle-channel-2574923canoeing-sea-beach-vacations-kayak-2412031canoeing-water-kayak-paddle-water-sports-1884182canoeing-water-river-boat-kayak-2920401canoes-water-mist-autumn-2914437cargo-ship-freighter-ship-moored-savanna-1646752cargo-ship-ocean-sea-inland-1101391cargo-ship-ocean-sea-inland-anchor-trans-1101389caribbean-sea-travel-vacations-2712422caribbean-sea-travel-vacations-2712423carnival-ships-ship-carnival-boat-2347517catamaran-boat-vessel-sea-travel-2288349channel-gondola-venetian-waters-3263252channel-gondola-venice-italy-water-2756416channel-houses-italy-venice-787234channel-venice-gondola-italy-water-656235city-stump-sitting-harbor-buoys-69494clearwater-villa-ocean-view-barbados-sai-1549553clipper-sail-boat-ocean-sea-ship-nautica-487503clipper-ship-sea-boat-ocean-sky-989030clipper-ship-tall-masts-sailing-812669clipper-ship-tall-masts-sailing-812699clouds-ship-sky-water-vacations-3589636coast-ship-pirates-sailboat-cyprus-ship--1136247colorful-blue-buoy-monument-beach-242730colorful-kayaks-for-sale-water-vacation--1553246colorline-color-fantasy-cruise-ship-1435642colorline-kiel-the-port-of-kiel-2787929competition-kayak-race-ocean-281903corsican-bonifacio-port-fortress-3717293crane-swimming-boat-harbor-float-629779crete-boat-sails-sea-water-greece-907242cruise-costa-pacifica-shipping-3526983cruise-cruise-ship-sea-water-3703998cruise-cruise-ship-sea-water-3703999cruise-cruise-ship-sea-water-3709528cruise-cruise-ship-ship-norway-fjord-mou-874485cruise-cruise-ship-ship-traffic-224125cruise-cruise-ship-vacations-sea-port-sh-823668cruise-hamburg-aida-prima-port-elbe-crui-1624522cruise-liner-asia-star-catamaran-616997cruise-liner-naval-ship-cruise-ship-ship-1292921cruise-liner-venice-cruise-liner-ship-tr-2157737cruise-scenic-travel-vacation-ship-touri-937069cruise-sea-ship-montenegro-yacht-cruise--1519026cruise-ship-aidamar-ship-cruises-3547170cruise-ship-boat-ocean-vacation-people-m-1775437cruise-ship-boat-sailing-travel-sea-ocea-1966903cruise-ship-boat-ship-ms-queen-victoria--334846cruise-ship-bridge-cruise-sea-2251245cruise-ship-bug-ship-aida-cruiser-507114cruise-ship-caribbean-travel-vacation-ho-1111541cruise-ship-costa-deliziosa-cruise-ship--1655058cruise-ship-cruise-cruiser-my-ship-1111663cruise-ship-cruise-norwegian-jade-3526976cruise-ship-cruise-sea-ocean-travel-vaca-336032cruise-ship-cruise-ship-ships-shipping-c-354433cruise-ship-cruise-ship-traffic-144831cruise-ship-cruise-ship-traffic-maritime-144830cruise-ship-cruise-ship-vacations-2860249cruise-ship-cruise-ship-vacations-boat-o-141710cruise-ship-cruise-vacation-travel-500349cruise-ship-cruiser-cruise-ship-1578528cruise-ship-cruiser-ship-cruise-vacation-295451cruise-ship-disney-cruise-line-private-i-615116cruise-ship-docked-cruise-ship-339328cruise-ship-holidays-cruise-290913cruise-ship-holidays-cruise-vacation-cru-114152cruise-ship-lake-vacations-sea-141708cruise-ship-line-drawing-cruise-ship-2293977cruise-ship-lisbon-cruise-summer-rooftop-917618cruise-ship-luxury-2549587cruise-ship-luxury-europe-mediterranean--1419799cruise-ship-mariner-of-the-seas-ship-roy-535814cruise-ship-mediterranean-sea-100872cruise-ship-mediterranean-sea-112002cruise-ship-mediterranean-sea-yacht-blue-572429cruise-ship-navy-ocean-vacations-3616353cruise-ship-night-neon-light-cruise-port-778533cruise-ship-oasis-of-the-seas-boat-water-482183cruise-ship-ocean-sea-water-shore-coast--1034620cruise-ship-port-tallinn-ship-3770958cruise-ship-royal-caribbean-jewel-of-the-500398cruise-ship-sea-clouds-caribbean-vacatio-1330416cruise-ship-sea-cruise-ships-water-ocean-141709cruise-ship-sea-ship-travel-ship-3544217cruise-ship-ship-berthed-shipyard-liner--433689cruise-ship-ship-bug-cruise-water-3669943cruise-ship-ship-cruise-holidays-cruise--295081cruise-ship-ship-shipping-cruise-port-tr-1875397cruise-ship-ship-ships-port-cruise-321507cruise-ship-sky-travel-ocean-sea-739153cruise-ship-storm-clouds-sea-sky-ocean-v-1323553cruise-ship-storm-clouds-sky-sea-caribbe-1331736cruise-ship-sydney-harbour-bridge-cruise-1029721cruise-ship-traditional-sea-horizon-2266719cruise-ship-travel-cruise-ship-3526985cruise-ship-travel-sea-vacation-1080291cruise-ship-tug-boat-ocean-sea-3712093cruise-ship-vacation-ocean-sea-3619202cruise-ship-vessel-ocean-vacation-people-1775445cruise-ships-baltic-cruise-ships-2423056cruise-ships-norwegian-star-norwegian-ge-1330422cruise-ships-ships-big-luxury-416933cruise-view-sea-blue-travel-2567069cruises-ship-cruise-travel-tourism-3526539cruises-shipping-msc-magnifica-3526975crusaders-bay-cannes-cte-d---azur-1557099danube-austria-river-river-cruise-3522075darling-harbour-sydney-australia-skyline-318508denmark-hornbck-sea-beach-sand-3616613denmark-sky-clouds-sunset-dusk-boats-shi-1823993direct-high-boat-sailboat-blue-3648585dock-ship-container-port-boat-vessel-sea-1277744dog-thoroughbred-sailboat-yacht-3146634driving-cruise-ship-night-port-ship-759796duck-sitting-floats-kayak-seat-3601384duisburg-landscape-park-2703550eat-ice-cream-gondola-dessert-isolated-s-2227140euro-ship-money-sailboat-origami-map-fin-1605659europa-sailboat-fs-senator-brockes-1185800evening-venice-gondola-tourists-3172877ferries-shipping-transport-cross-53121ferries-shipping-transport-cross-53122ferry-boat-black-sign-symbol-icon-99055ferry-boat-boat-transportation-sea-3058297ferry-boat-boat-travel-sea-vessel-2709839ferry-boat-ferry-ship-boat-123059ferry-boat-sea-ship-blue-ferry-ferry-fer-157517ferry-boat-sea-ship-red-ferry-boat-ship--157516ferry-boat-ship-sea-transport-2766582ferry-boat-ship-water-port-lake-3598776ferry-boat-transportation-ship-water-tra-1956735ferry-boat-travel-tourist-summer-20144ferry-boat-water-puget-sound-seattle-sea-19524ferry-boat-water-sea-ship-croatia-1648809ferry-boat-watercraft-ship-ferryboat-sea-99054ferry-boats-dock-port-beach-lake-123648ferry-cargo-ship-carrier-the-barge-venic-2081778ferry-catamaran-ship-boat-ocean-982825ferry-cruise-swim-lake-bodensee-3601612ferry-dock-transportation-boat-2907174ferry-ferry-boat-car-ferry-99259ferry-ferry-boat-car-ferry-99260ferry-ferry-port-loth-orkney-1007361ferry-harbor-boat-pacific-harbour-68698ferry-in-bayfield-harbor-3529561ferry-lake-constance-car-ferry-ship-2440952ferry-north-sea-ferry-terminal-401838ferry-passenger-ship-ship-638153ferry-sea-ship-water-boat-wide-1251133ferry-ship-boat-car-ferry-gierseilffre--1609682ferry-ship-boat-sea-lake-water-1728842ferry-ship-boat-transport-357646ferry-ship-boat-water-sea-river-3418296ferry-ship-hong-kong-cruise-victoria-har-560528ferry-ship-port-water-boat-cruise-3763312ferry-staten-island-new-york-manhattan-b-799428ferryboat-ferry-boat-symbol-ship-journey-303660figure-watercolor-painting-boy-3363370fisherman-angler-fishing-river-angling-k-850453fiumanka-sailing-race-sailboat-yacht-win-1049747fjord-norway-fjordlandschaft-mountains-l-915151fjord-norway-fjordlandschaft-mountains-l-940524float-water-blue-sea-blue-water-1586018floats-boa-float-water-lake-1286514florida-coast-ocean-key-west-water-ship--67893fog-port-boat-buoy-metal-rusty-3707902fold-paper-boat-water-abstract-2463747frachtschiff-autotransport-3498344freight-liner-ship-liner-shipping-2736640freight-liner-ship-liner-shipping-2736641freight-liner-ship-liner-shipping-2736642freighter-cargo-ship-transport-2432936frog-photographer-giant-funny-1158815galleon-sailing-ship-sail-ship-sailing-m-146994galleon-ship-historic-moored-sail-vessel-1572631ghent-belgium-architecture-building-3736082girl-kayak-canoe-kayaking-paddle-1561989glacier-kayak-alaska-ice-2687834gondola-boat-bridge-water-art-3742235gondola-boat-las-vegas-venice-venetian-l-655864gondola-boat-oar-guy-man-water-698452gondola-channel-boat-waters-3109128gondola-gondola-ride-venice-water-2814777gondola-gondolier-grand-canal-528783gondola-gondolier-venice-261311gondola-gondolier-venice-channel-2723535gondolas-venice-italy-2451776gondola-travel-venice-europe-3701751gondola-venetia-venezia-venice-italy-ita-1712314gondola-venezia-travel-italy-2242603gondola-venice-boat-art-watercolor-3605827gondola-venice-boats-ship-way-2112568gondola-venice-canal-grande-italy-2913954gondola-venice-channel-italy-black-venic-505090gondola-venice-italy-canal-romantic-ital-2092617gondola-venice-italy-decoration-682263gondola-venice-italy-europe-travel-2448353gondola-venice-italy-travel-boat-619646gondola-venice-italy-water-boats-houses--926883gondola-venice-italy-water-canal-277780gondola-venice-italy-water-canal-venice--175880gondola-venice-italy-water-people-1610598gondola-water-venice-channel-2814745gondolas-canale-grande-rialto-bridge-2785566gondolas-channels-venice-architecture-st-614838gondolas-italy-venice-gondolier-channel--457751gondolas-venice-dusk-sunset-842716gondolas-venice-italy-86636gondolas-venice-italy-houses-457722gondolas-venice-italy-vacations-2785565gondolas-venice-laguna-italy-2800598gondolas-venice-river-houses-italy-447932gondolas-venice-water-italy-gondolier-ve-2112575gondolier-gondola-venice-vinegia-venetia-29216gondolier-italy-venice-gondolas-secondar-337547gondolier-venice-water-romantic-venezia--667566gorges-you-verdon-kayak-drive-mirroring--1603829grand-canal-grand-canal-venice-1246629grand-canal-venice-italy-canal-city-wate-918699greece-olympia-sea-cruise-boat-106245greece-olympia-sea-cruise-boat-ship-medi-106246greece-rhodes-sea-water-boat-sailing-boa-848987greece-sea-sailboat-roof-mountains-vacat-2228690ha-long-bay-vietnam-travel-cruise-2404431haiti-ferry-boat-ship-harbor-port-pier-b-79643hamburg-germany-port-harbor-180055hamburg-night-hafengeburtstag-cruise-shi-345107hamburg-port-elbe-hanseatic-city-2187865harbor-pier-water-sea-yacht-3120195harbor-port-sailboat-boat-marseille-fran-1883510harbour-port-boats-boat-cruise-3104300hat-gondola-venice-color-seat-2756307hermione-charente-sailboat-3139518holiday-landscape-boat-sailboat-3637125holiday-landscape-boat-sailboat-3637129holiday-sailboat-sunset-boating-sailing--25657holidays-travel-vacations-cruise-3585521honfleur-port-old-people-historical-3624517hongkong-ferry-hong-kong-asia-2659491hongkong-ferry-hong-kong-asia-2664970hongkong-ferry-hong-kong-asia-2664973horizon-beach-pier-post-glare-2300196house-sea-seaside-blue-nature-1307469house-summer-seaside-sand-beach-sea-blue-1956046human-gondola-channel-city-urban-3109122human-steward-ship-cruise-cruise-ship-po-740325inflatable-dinghy-pneumatic-boat-1977467int-ocean-international-sea-buoy-39267int-ocean-sea-maritime-buoy-39268island-buoy-beach-west-sea-2710854island-queen-3524117island-sailing-boat-greece-sea-3776435istanbul-city-architecture-view-cruise-s-808394istanbul-ship-sultanahmet-bosphorus-2912248kayak-boat-rio-2714529istanbul-ship-sultanahmet-bosphorus-2912249istanbul-turkey-cruise-bosphorus-782847italy-gondola-blue-dock-venice-518578italy-venessia-the-gondolier-3779694italy-venessia-the-gondolier-3779787italy-venezia-gondola-gondolier-2817710italy-venice-arrival-channel-city-3523866italy-venice-bridge-the-bridge-of-sighs--1357054italy-venice-canale-grande-gondolas-1240477italy-venice-channel-gondolas-2830397italy-venice-gondola-venice-italy-2902070italy-venice-gondolas-boats-829151italy-venice-gondolas-invitation-3367960italy-venice-gondolas-rio-channel-1315871italy-venice-venezia-canale-grande-694480italy-venice-water-gondola-architecture--1747913jetty-pier-fog-foggy-morning-2767167juneau-alaska-city-cities-urban-view-mou-1620945kayak-baltic-sea-sweden-coast-2465680kayak-beach-resort-island-travel-2404711kayak-beach-resort-island-travel-2404714kayak-boat-blue-ocean-sea-paddling-water-349674kayak-boat-canoe-paddling-river-309047kayak-boat-canoeing-paddle-sport-2565625kayak-boat-lake-kayaking-water-2483029kayak-boat-paddling-kayaking-kayaker-kay-350476kayak-boat-red-blue-sport-kayaking-canoe-91953kayak-boat-rowing-landscape-sport-nature-1442939kayak-boat-water-kayaking-sport-sea-padd-833928kayak-boat-water-paddle-kayaking-sport-l-1541212kayak-canoe-boat-kayaks-rafting-281836kayak-canoe-paddles-paddling-fisherman-s-233177kayak-canoeing-boats-water-lake-silent-w-429597kayak-canoeing-sea-beach-yellow-197949kayak-canoeing-wannsee-paddle-2795514kayak-canoeists-water-sport-people-445219kayak-coast-rocks-shore-lake-2683879kayak-coast-tourism-sea-3190733kayak-creek-water-river-kayaking-343728kayak-fun-vacation-1536232kayak-kayaker-boat-paddle-river-sport-wa-476861kayak-kayaker-kayaking-oar-boat-sport-ac-168006kayak-kayaking-activity-adventure-soa-s-984569kayak-kayaking-kayaker-water-blue-river--163892kayak-kayaking-lake-water-paddle-2618298kayak-kayaking-people-water-sport-summer-1664061kayak-kayaking-sport-active-soa-sloveni-984566kayak-kayaking-water-sport-kayak-kayak-k-603314kayak-kayaks-beach-sea-kayaking-sit-on-t-969043kayak-lake-nature-landscape-river-1323299kayak-lake-outdoors-sport-recreation-kay-1465191kayak-lake-paddle-sport-summer-2758691kayak-lake-summer-nature-kayaking-recrea-437419kayak-lake-water-kayaking-recreation-act-89252venetian-las-vegas-gondolas-canal-archit-562758venezia-canal-venice-travel-italy-973181venezia-venice-summer-gondola-2112543venice-architecture-tourism-2713675venice-boat-chair-gondola-938663venice-boat-gondola-gondolier-938664venice-bridge-canale-grande-channel-1029369venice-bridge-sighs-gondola-water-1546899venice-canal-italy-landmark-city-2224803venice-canale-grande-gondolas-211561venice-canale-grande-gondolier-city-3183168venice-canale-grande-italy-venezia-1585215venice-canale-grande-rialto-bridge-3655034venice-canale-grande-rialto-bridge-italy-1721988venice-channel-gondola-italy-3451352venice-channel-gondolas-640624venice-channel-great-canal-gondola-3401265venice-channel-road-cafe-bridge-2831600venice-city-gondolas-travel-italy-174693venice-cruise-ship-port-sky-cruise-cruis-780865venice-doge-s-palace-venezia-2834170venice-facade-sky-colorful-2659940venice-glimpse-gondolas-venice-venice-ve-2048971venice-gondola-black-and-white-3559620venice-gondola-blue-2444521venice-gondola-boat-3525930venice-gondola-boats-italy-city-1798350venice-gondola-canal-boat-italy-3570112venice-gondola-canal-grande-italy-2898775venice-gondola-canal-restaurant-2582514venice-gondola-canals-water-italy-2539025venice-gondola-channel-3423479venice-gondola-channel-venice-venice-ven-2086738venice-gondola-channel-water-houses-wate-2086292venice-gondola-decoration-channel-1075057venice-gondola-gondolier-midnight-2818369venice-gondola-houses-channel-2801832venice-gondola-italy-channel-238413venice-gondola-italy-gondolas-sea-2269316venice-gondola-italy-travel-canal-2682767venice-gondola-italy-travel-europe-2440552venice-gondola-italy-water-203505venice-gondola-italy-water-2987350venice-gondola-midnight-in-love-2798010venice-gondola-rialto-bridge-water-864276venice-gondola-sea-laguna-italy-213935venice-gondola-venetian-italy-gondlier-w-1612069venice-gondola-veneto-gondolier-3700015venice-gondola-water-buildings-channel-i-955548venice-gondola-water-italy-boats-venice--1755499venice-gondolas-architecture-italy-2110265venice-gondolas-boats-sea-water-775463venice-gondolas-italy-water-gondola-cana-427209venice-gondolas-italy-water-venice-venic-973636venice-gondolas-water-italy-806855venice-gondolier-gondola-italian-2467369venice-grand-canal-gondola-italian-2708446venice-grand-canal-italy-europe-night-il-918691venice-grand-canal-water-boats-gondolas--1524263venice-grand-canal-water-boats-gondolas--1705482venice-grand-canal-water-boats-gondolas--1843151venice-italy-architecture-channel-2642242venice-italy-architecture-channel-2667960venice-italy-architecture-channel-2695160venice-italy-architecture-channel-2695193venice-italy-architecture-channel-2699806venice-italy-architecture-palace-2927570venice-italy-basilica-gondola-laguna-arc-1165234venice-italy-boats-city-urban-3531487venice-italy-bridge-of-sighs-2494237venice-italy-canal-architecture-1611133venice-italy-canal-landmark-city-3733136venice-italy-channel-gondola-gondolas-ba-2147634venice-italy-cruise-ship-gondolas-2554244venice-italy-europe-travel-water-639479venice-italy-europe-travel-water-640555venice-italy-fog-europe-travel-598580venice-italy-gondola-3061955venice-italy-gondola-3526646venice-italy-gondola-boat-canal-2708291venice-italy-gondola-bridge-channel-sea--472344venice-italy-gondola-bridge-laguna-472346venice-italy-gondola-buildings-352776venice-italy-gondola-buildings-357234venice-italy-gondola-buildings-city-arch-341468venice-italy-gondola-channel-2855271venice-italy-gondola-channel-water-2855269venice-italy-gondola-channel-water-venic-472347venice-italy-gondola-europe-travel-631362venice-italy-gondola-gondolier-2551486venice-italy-gondola-gondoliers-canal-tr-1606929venice-italy-gondola-gondoliers-canal-tr-1606938venice-italy-gondola-grand-canal-1602991venice-italy-gondola-outdoor-1602993venice-italy-gondola-outdoor-scenic-arch-1602994venice-italy-gondola-sky-bridge-europe-c-1610395venice-italy-gondola-venetian-canal-3061058venice-italy-gondola-water-boat-173336venice-italy-gondola-water-splash-touris-2208936venice-italy-gondolas-175984venice-italy-gondolas-channel-venice-ven-1276664venice-italy-gondolas-gondoliers-2554255venice-italy-gondolas-lamp-dock-2554236venice-italy-gondolas-tourism-3396046venice-italy-lagoon-venezia-974674venice-italy-laguna-sea-gondola-472349venice-italy-rialto-bridge-1602992venice-italy-street-view-buildings-2637924venice-italy-tourism-the-old-town-2700045venice-italy-travel-water-europe-2755165venice-italy-traveling-europe-287976venice-italy-vacation-cityscape-italian--1952633venice-italy-venetian-canal-water-3057446venice-italy-venezia-sea-cruise-ship-cru-321271venice-italy-venezia-water-channel-2724167venice-italy-water-architecture-3738518venice-italy-water-europe-canal-173337venice-italy-water-gondola-channel-2635393venice-pollution-cruise-ship-2522538venice-rialto-canal-italy-gondola-3699419venice-rialto-italy-bridge-grand-canal-g-2085864venice-roofs-channel-italy-venezia-3468785venice-sea-gondola-italy-building-2677212venice-sea-holidays-italy-venezia-998162venice-taly-gondola-water-106666venice-taly-gondola-water-boating-106669venice-town-on-the-river-191575venice-vacations-italy-water-185829venice-venetian-evening-gondola-3228796venice-venezia-historically-italy-2881519venice-venezia-italy-203467victoria-bc-discovery-island-kayak-2459392vintage-travel-travel-poster-poster-vaca-1705056virgin-islands-cruise-ship-st-thomas-vie-949870vision-the-seas-cozumel-cruise-ship-ship-1021676vortex-the-sea-sailboat-japan-2433857water-inflatable-boat-sea-boa-yet-199811water-kayak-pictogram-lake-river-helmet--307676water-ocean-canoe-sea-summer-3359746water-on-the-water-swim-boat-3604872water-person-mountain-admiring-happy-hol-807209water-removal-ulm-danube-water-189483water-removal-ulm-danube-water-189488water-removal-ulm-danube-water-189489water-removal-ulm-danube-water-189490water-river-kayak-landscape-2506943water-sailboat-sail-ship-3100024water-sea-coast-beach-ocean-wave-3261036water-sea-coral-fish-ocean-reef-3359672water-sea-ocean-cloud-wave-blue-1169849water-sea-sailboat-sail-ocean-3230104water-sea-ship-boat-ocean-cruise-3297593water-sea-sky-nature-side-3624707water-sea-travel-sailboat-yacht-3279871water-sea-travel-ship-boat-cruise-3123536watercolour-seascape-sea-coast-scene-sce-1562919watercraft-sailboat-sail-ship-3195766watercraft-vehicle-sailboat-transportati-2167720waterfall-i-with-kayaks-rafting-water-ka-1549635waterfall-i-with-kayaks-rafting-water-ka-1549639waterfall-oregon-bridal-veil-falls-kayak-300536watermarkering-scheepvaartmarkering-2714076waters-boat-transport-system-port-3257692waterway-canale-grande-venice-321295whitewater-kayaking-kayak-river-3402204winter-ice-snow-ferry-waters-3197873yacht-racing-sail-boat-sport-sea-642067yacht-refuge-sea-marina-pier-3370810yacht-sailboat-boat-sport-3101821yacht-sailing-sailboat-sea-cruise-yachti-26603yacht-sailing-ship-nautical-holiday-887969yacht-sea-boat-travel-ship-ocean-summer--802319yachting-competition-sea-yacht-3382391yachting-competition-sea-yacht-3382392yachts-sail-sea-water-boat-travel-nautic-2107523yachts-sail-sea-water-boat-travel-nautic-2107531zachranari-inflatable-boat-ocean-846324zrich-river-kayak-water-centre-zurich-s-30030112345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061#----------------------------------------------------------------------## 验证集的划分在train.py代码里面进行# test.txt和val.txt里面没有内容是正常的。训练不会使用到。#----------------------------------------------------------------------#'''#--------------------------------注意----------------------------------#如果在pycharm中运行时提示:FileNotFoundError: [WinError 3] 系统找不到指定的路径。: './VOCdevkit/VOC2007/Annotations'这是pycharm运行目录的问题,最简单的方法是将该文件复制到根目录后运行。可以查询一下相对目录和根目录的概念。在VSCODE中没有这个问题。#--------------------------------注意----------------------------------#'''import osimport random random.seed(0)
xmlfilepath=r'/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/Annotations'saveBasePath=r"/root/Desktop/yolov4_pytorch_down_1fpn/VOCdevkit/VOC2007/ImageSets/Main/" #----------------------------------------------------------------------## 想要增加测试集修改trainval_percent# train_percent不需要修改#----------------------------------------------------------------------#trainval_percent=1train_percent=1
temp_xml = os.listdir(xmlfilepath)total_xml = []for xml in temp_xml: if xml.endswith(".xml"): total_xml.append(xml)
num=len(total_xml) list=range(num) tv=int(num*trainval_percent) tr=int(tv*train_percent) trainval= random.sample(list,tv) train=random.sample(trainval,tr) print("train and val size",tv)print("traub suze",tr)ftrainval = open(os.path.join(saveBasePath,'trainval.txt'), 'w') ftest = open(os.path.join(saveBasePath,'test.txt'), 'w') ftrain = open(os.path.join(saveBasePath,'train.txt'), 'w') fval = open(os.path.join(saveBasePath,'val.txt'), 'w') for i in list: name=total_xml[i][:-4]+'\n' if i in trainval: ftrainval.write(name) if i in train: ftrain.write(name) else: fval.write(name) else: ftest.write(name) ftrainval.close() ftrain.close() fval.close() ftest .close()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144#-------------------------------------## mAP所需文件计算代码# 具体教程请查看Bilibili# Bubbliiiing#-------------------------------------#import colorsysimport os
import cv2import numpy as npimport torchimport torch.backends.cudnn as cudnnimport torch.nn as nnfrom PIL import Image, ImageDraw, ImageFontfrom torch.autograd import Variablefrom tqdm import tqdm
from nets.yolo4 import YoloBodyfrom utils.utils import (DecodeBox, bbox_iou, letterbox_image, non_max_suppression, yolo_correct_boxes)from yolo import YOLO
'''这里设置的门限值较低是因为计算map需要用到不同门限条件下的Recall和Precision值。所以只有保留的框足够多,计算的map才会更精确,详情可以了解map的原理。计算map时输出的Recall和Precision值指的是门限为0.5时的Recall和Precision值。
此处获得的./input/detection-results/里面的txt的框的数量会比直接predict多一些,这是因为这里的门限低,目的是为了计算不同门限条件下的Recall和Precision值,从而实现map的计算。
这里的self.iou指的是非极大抑制所用到的iou,具体的可以了解非极大抑制的原理,如果低分框与高分框的iou大于这里设定的self.iou,那么该低分框将会被剔除。
可能有些同学知道有0.5和0.5:0.95的mAP,这里的self.iou=0.5不代表mAP0.5。如果想要设定mAP0.x,比如设定mAP0.75,可以去get_map.py设定MINOVERLAP。'''class mAP_Yolo(YOLO): #---------------------------------------------------# # 检测图片 #---------------------------------------------------# def detect_image(self,image_id,image): self.confidence = 0.01 self.iou = 0.5 f = open("./input/detection-results/"+image_id+".txt","w") image_shape = np.array(np.shape(image)[0:2])
#---------------------------------------------------------# # 给图像增加灰条,实现不失真的resize # 也可以直接resize进行识别 #---------------------------------------------------------# if self.letterbox_image: crop_img = np.array(letterbox_image(image, (self.model_image_size[1],self.model_image_size[0]))) else: crop_img = image.convert('RGB') crop_img = crop_img.resize((self.model_image_size[1],self.model_image_size[0]), Image.BICUBIC) photo = np.array(crop_img,dtype = np.float32) / 255.0 photo = np.transpose(photo, (2, 0, 1)) #---------------------------------------------------------# # 添加上batch_size维度 #---------------------------------------------------------# images = [photo]
with torch.no_grad(): images = torch.from_numpy(np.asarray(images)) if self.cuda: images = images.cuda()
#---------------------------------------------------------# # 将图像输入网络当中进行预测! #---------------------------------------------------------# outputs = self.net(images) output_list = [] for i in range(5): output_list.append(self.yolo_decodes[i](outputs[i]))
#---------------------------------------------------------# # 将预测框进行堆叠,然后进行非极大抑制 #---------------------------------------------------------# output = torch.cat(output_list, 1) batch_detections = non_max_suppression(output, len(self.class_names), conf_thres=self.confidence, nms_thres=self.iou)
#---------------------------------------------------------# # 如果没有检测出物体,返回原图 #---------------------------------------------------------# try: batch_detections = batch_detections[0].cpu().numpy() except: return #---------------------------------------------------------# # 对预测框进行得分筛选 #---------------------------------------------------------# top_index = batch_detections[:,4] * batch_detections[:,5] > self.confidence top_conf = batch_detections[top_index,4]*batch_detections[top_index,5] top_label = np.array(batch_detections[top_index,-1],np.int32) top_bboxes = np.array(batch_detections[top_index,:4]) top_xmin, top_ymin, top_xmax, top_ymax = np.expand_dims(top_bboxes[:,0],-1),np.expand_dims(top_bboxes[:,1],-1),np.expand_dims(top_bboxes[:,2],-1),np.expand_dims(top_bboxes[:,3],-1)
#-----------------------------------------------------------------# # 在图像传入网络预测前会进行letterbox_image给图像周围添加灰条 # 因此生成的top_bboxes是相对于有灰条的图像的 # 我们需要对其进行修改,去除灰条的部分。 #-----------------------------------------------------------------# if self.letterbox_image: boxes = yolo_correct_boxes(top_ymin,top_xmin,top_ymax,top_xmax,np.array([self.model_image_size[0],self.model_image_size[1]]),image_shape) else: top_xmin = top_xmin / self.model_image_size[1] * image_shape[1] top_ymin = top_ymin / self.model_image_size[0] * image_shape[0] top_xmax = top_xmax / self.model_image_size[1] * image_shape[1] top_ymax = top_ymax / self.model_image_size[0] * image_shape[0] boxes = np.concatenate([top_ymin,top_xmin,top_ymax,top_xmax], axis=-1) for i, c in enumerate(top_label): predicted_class = self.class_names[c] score = str(top_conf[i])
top, left, bottom, right = boxes[i] f.write("%s %s %s %s %s %s\n" % (predicted_class, score[:6], str(int(left)), str(int(top)), str(int(right)),str(int(bottom))))
f.close() return
yolo = mAP_Yolo()image_ids = open('VOCdevkit/VOC2007/ImageSets/Main/test.txt').read().strip().split()
if not os.path.exists("./input"): os.makedirs("./input")if not os.path.exists("./input/detection-results"): os.makedirs("./input/detection-results")if not os.path.exists("./input/images-optional"): os.makedirs("./input/images-optional")
for image_id in tqdm(image_ids): image_path = "./VOCdevkit/VOC2007/JPEGImages/"+image_id+".jpg" image = Image.open(image_path) # 开启后在之后计算mAP可以可视化 # image.save("./input/images-optional/"+image_id+".jpg") yolo.detect_image(image_id,image) print("Conversion completed!")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263#----------------------------------------------------## 获取测试集的ground-truth# 具体视频教程可查看# https://www.bilibili.com/video/BV1zE411u7Vw#----------------------------------------------------#import sysimport osimport globimport xml.etree.ElementTree as ET
'''!!!!!!!!!!!!!注意事项!!!!!!!!!!!!!# 这一部分是当xml有无关的类的时候,下方有代码可以进行筛选!'''#---------------------------------------------------## 获得类#---------------------------------------------------#def get_classes(classes_path): '''loads the classes''' with open(classes_path) as f: class_names = f.readlines() class_names = [c.strip() for c in class_names] return class_names
image_ids = open('VOCdevkit/VOC2007/ImageSets/Main/test.txt').read().strip().split()
if not os.path.exists("./input"): os.makedirs("./input")if not os.path.exists("./input/ground-truth"): os.makedirs("./input/ground-truth")
for image_id in image_ids: with open("./input/ground-truth/"+image_id+".txt", "w") as new_f: root = ET.parse("VOCdevkit/VOC2007/Annotations/"+image_id+".xml").getroot() for obj in root.findall('object'): difficult_flag = False if obj.find('difficult')!=None: difficult = obj.find('difficult').text if int(difficult)==1: difficult_flag = True obj_name = obj.find('name').text ''' !!!!!!!!!!!!注意事项!!!!!!!!!!!! # 这一部分是当xml有无关的类的时候,可以取消下面代码的注释 # 利用对应的classes.txt来进行筛选!!!!!!!!!!!! ''' # classes_path = 'model_data/voc_classes.txt' # class_names = get_classes(classes_path) # if obj_name not in class_names: # continue
bndbox = obj.find('bndbox') left = bndbox.find('xmin').text top = bndbox.find('ymin').text right = bndbox.find('xmax').text bottom = bndbox.find('ymax').text
if difficult_flag: new_f.write("%s %s %s %s %s difficult\n" % (obj_name, left, top, right, bottom)) else: new_f.write("%s %s %s %s %s\n" % (obj_name, left, top, right, bottom))
print("Conversion completed!")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901import globimport jsonimport osimport shutilimport operatorimport sysimport argparseimport math
import numpy as np
'''用于计算mAP代码克隆自https://github.com/Cartucho/mAP如果想要设定mAP0.x,比如计算mAP0.75,可以设定MINOVERLAP = 0.75。'''MINOVERLAP = 0.5# 31.23 17.85 0.96parser = argparse.ArgumentParser()parser.add_argument('-na', '--no-animation', help="no animation is shown.", action="store_true")parser.add_argument('-np', '--no-plot', help="no plot is shown.", action="store_true")parser.add_argument('-q', '--quiet', help="minimalistic console output.", action="store_true")parser.add_argument('-i', '--ignore', nargs='+', type=str, help="ignore a list of classes.")parser.add_argument('--set-class-iou', nargs='+', type=str, help="set IoU for a specific class.")args = parser.parse_args()
''' 0,0 ------> x (width) | | (Left,Top) | *_________ | | | | | y |_________| (height) * (Right,Bottom)'''
if args.ignore is None: args.ignore = []
specific_iou_flagged = Falseif args.set_class_iou is not None: specific_iou_flagged = True
os.chdir(os.path.dirname(os.path.abspath(__file__)))
GT_PATH = os.path.join(os.getcwd(), 'input', 'ground-truth')DR_PATH = os.path.join(os.getcwd(), 'input', 'detection-results')IMG_PATH = os.path.join(os.getcwd(), 'input', 'images-optional')if os.path.exists(IMG_PATH): for dirpath, dirnames, files in os.walk(IMG_PATH): if not files: args.no_animation = Trueelse: args.no_animation = True
show_animation = Falseif not args.no_animation: try: import cv2 show_animation = True except ImportError: print("\"opencv-python\" not found, please install to visualize the results.") args.no_animation = True
draw_plot = Falseif not args.no_plot: try: import matplotlib.pyplot as plt draw_plot = True except ImportError: print("\"matplotlib\" not found, please install it to get the resulting plots.") args.no_plot = True
def log_average_miss_rate(precision, fp_cumsum, num_images): """ log-average miss rate: Calculated by averaging miss rates at 9 evenly spaced FPPI points between 10e-2 and 10e0, in log-space.
output: lamr | log-average miss rate mr | miss rate fppi | false positives per image
references: [1] Dollar, Piotr, et al. "Pedestrian Detection: An Evaluation of the State of the Art." Pattern Analysis and Machine Intelligence, IEEE Transactions on 34.4 (2012): 743 - 761. """
if precision.size == 0: lamr = 0 mr = 1 fppi = 0 return lamr, mr, fppi
fppi = fp_cumsum / float(num_images) mr = (1 - precision)
fppi_tmp = np.insert(fppi, 0, -1.0) mr_tmp = np.insert(mr, 0, 1.0)
ref = np.logspace(-2.0, 0.0, num = 9) for i, ref_i in enumerate(ref): j = np.where(fppi_tmp <= ref_i)[-1][-1] ref[i] = mr_tmp[j]
lamr = math.exp(np.mean(np.log(np.maximum(1e-10, ref))))
return lamr, mr, fppi
""" throw error and exit"""def error(msg): print(msg) sys.exit(0)
""" check if the number is a float between 0.0 and 1.0"""def is_float_between_0_and_1(value): try: val = float(value) if val > 0.0 and val < 1.0: return True else: return False except ValueError: return False
""" Calculate the AP given the recall and precision array 1st) We compute a version of the measured precision/recall curve with precision monotonically decreasing 2nd) We compute the AP as the area under this curve by numerical integration."""def voc_ap(rec, prec): """ --- Official matlab code VOC2012--- mrec=[0 ; rec ; 1]; mpre=[0 ; prec ; 0]; for i=numel(mpre)-1:-1:1 mpre(i)=max(mpre(i),mpre(i+1)); end i=find(mrec(2:end)~=mrec(1:end-1))+1; ap=sum((mrec(i)-mrec(i-1)).*mpre(i)); """ rec.insert(0, 0.0) # insert 0.0 at begining of list rec.append(1.0) # insert 1.0 at end of list mrec = rec[:] prec.insert(0, 0.0) # insert 0.0 at begining of list prec.append(0.0) # insert 0.0 at end of list mpre = prec[:] """ This part makes the precision monotonically decreasing (goes from the end to the beginning) matlab: for i=numel(mpre)-1:-1:1 mpre(i)=max(mpre(i),mpre(i+1)); """ for i in range(len(mpre)-2, -1, -1): mpre[i] = max(mpre[i], mpre[i+1]) """ This part creates a list of indexes where the recall changes matlab: i=find(mrec(2:end)~=mrec(1:end-1))+1; """ i_list = [] for i in range(1, len(mrec)): if mrec[i] != mrec[i-1]: i_list.append(i) # if it was matlab would be i + 1 """ The Average Precision (AP) is the area under the curve (numerical integration) matlab: ap=sum((mrec(i)-mrec(i-1)).*mpre(i)); """ ap = 0.0 for i in i_list: ap += ((mrec[i]-mrec[i-1])*mpre[i]) return ap, mrec, mpre
""" Convert the lines of a file to a list"""def file_lines_to_list(path): # open txt file lines to a list with open(path) as f: content = f.readlines() # remove whitespace characters like `\n` at the end of each line content = [x.strip() for x in content] return content
""" Draws text in image"""def draw_text_in_image(img, text, pos, color, line_width): font = cv2.FONT_HERSHEY_PLAIN fontScale = 1 lineType = 1 bottomLeftCornerOfText = pos cv2.putText(img, text, bottomLeftCornerOfText, font, fontScale, color, lineType) text_width, _ = cv2.getTextSize(text, font, fontScale, lineType)[0] return img, (line_width + text_width)
""" Plot - adjust axes"""def adjust_axes(r, t, fig, axes): # get text width for re-scaling bb = t.get_window_extent(renderer=r) text_width_inches = bb.width / fig.dpi # get axis width in inches current_fig_width = fig.get_figwidth() new_fig_width = current_fig_width + text_width_inches propotion = new_fig_width / current_fig_width # get axis limit x_lim = axes.get_xlim() axes.set_xlim([x_lim[0], x_lim[1]*propotion])
""" Draw plot using Matplotlib"""def draw_plot_func(dictionary, n_classes, window_title, plot_title, x_label, output_path, to_show, plot_color, true_p_bar): # sort the dictionary by decreasing value, into a list of tuples sorted_dic_by_value = sorted(dictionary.items(), key=operator.itemgetter(1)) # unpacking the list of tuples into two lists sorted_keys, sorted_values = zip(*sorted_dic_by_value) # if true_p_bar != "": """ Special case to draw in: - green -> TP: True Positives (object detected and matches ground-truth) - red -> FP: False Positives (object detected but does not match ground-truth) - orange -> FN: False Negatives (object not detected but present in the ground-truth) """ fp_sorted = [] tp_sorted = [] for key in sorted_keys: fp_sorted.append(dictionary[key] - true_p_bar[key]) tp_sorted.append(true_p_bar[key]) plt.barh(range(n_classes), fp_sorted, align='center', color='crimson', label='False Positive') plt.barh(range(n_classes), tp_sorted, align='center', color='forestgreen', label='True Positive', left=fp_sorted) # add legend plt.legend(loc='lower right') """ Write number on side of bar """ fig = plt.gcf() # gcf - get current figure axes = plt.gca() r = fig.canvas.get_renderer() for i, val in enumerate(sorted_values): fp_val = fp_sorted[i] tp_val = tp_sorted[i] fp_str_val = " " + str(fp_val) tp_str_val = fp_str_val + " " + str(tp_val) # trick to paint multicolor with offset: # first paint everything and then repaint the first number t = plt.text(val, i, tp_str_val, color='forestgreen', va='center', fontweight='bold') plt.text(val, i, fp_str_val, color='crimson', va='center', fontweight='bold') if i == (len(sorted_values)-1): # largest bar adjust_axes(r, t, fig, axes) else: plt.barh(range(n_classes), sorted_values, color=plot_color) """ Write number on side of bar """ fig = plt.gcf() # gcf - get current figure axes = plt.gca() r = fig.canvas.get_renderer() for i, val in enumerate(sorted_values): str_val = " " + str(val) # add a space before if val < 1.0: str_val = " {0:.2f}".format(val) t = plt.text(val, i, str_val, color=plot_color, va='center', fontweight='bold') # re-set axes to show number inside the figure if i == (len(sorted_values)-1): # largest bar adjust_axes(r, t, fig, axes) # set window title fig.canvas.set_window_title(window_title) # write classes in y axis tick_font_size = 12 plt.yticks(range(n_classes), sorted_keys, fontsize=tick_font_size) """ Re-scale height accordingly """ init_height = fig.get_figheight() # comput the matrix height in points and inches dpi = fig.dpi height_pt = n_classes * (tick_font_size * 1.4) # 1.4 (some spacing) height_in = height_pt / dpi # compute the required figure height top_margin = 0.15 # in percentage of the figure height bottom_margin = 0.05 # in percentage of the figure height figure_height = height_in / (1 - top_margin - bottom_margin) # set new height if figure_height > init_height: fig.set_figheight(figure_height)
# set plot title plt.title(plot_title, fontsize=14) # set axis titles # plt.xlabel('classes') plt.xlabel(x_label, fontsize='large') # adjust size of window fig.tight_layout() # save the plot fig.savefig(output_path) # show image if to_show: plt.show() # close the plot plt.close()
""" Create a ".temp_files/" and "results/" directory"""TEMP_FILES_PATH = ".temp_files"if not os.path.exists(TEMP_FILES_PATH): # if it doesn't exist already os.makedirs(TEMP_FILES_PATH)results_files_path = "results"if os.path.exists(results_files_path): # if it exist already # reset the results directory shutil.rmtree(results_files_path)
os.makedirs(results_files_path)if draw_plot: os.makedirs(os.path.join(results_files_path, "AP")) os.makedirs(os.path.join(results_files_path, "F1")) os.makedirs(os.path.join(results_files_path, "Recall")) os.makedirs(os.path.join(results_files_path, "Precision"))if show_animation: os.makedirs(os.path.join(results_files_path, "images", "detections_one_by_one"))
""" ground-truth Load each of the ground-truth files into a temporary ".json" file. Create a list of all the class names present in the ground-truth (gt_classes)."""# get a list with the ground-truth filesground_truth_files_list = glob.glob(GT_PATH + '/*.txt')if len(ground_truth_files_list) == 0: error("Error: No ground-truth files found!")ground_truth_files_list.sort()# dictionary with counter per classgt_counter_per_class = {}counter_images_per_class = {}
for txt_file in ground_truth_files_list: #print(txt_file) file_id = txt_file.split(".txt", 1)[0] file_id = os.path.basename(os.path.normpath(file_id)) # check if there is a correspondent detection-results file temp_path = os.path.join(DR_PATH, (file_id + ".txt")) if not os.path.exists(temp_path): error_msg = "Error. File not found: {}\n".format(temp_path) error_msg += "(You can avoid this error message by running extra/intersect-gt-and-dr.py)" error(error_msg) lines_list = file_lines_to_list(txt_file) # create ground-truth dictionary bounding_boxes = [] is_difficult = False already_seen_classes = [] for line in lines_list: try: if "difficult" in line: class_name, left, top, right, bottom, _difficult = line.split() is_difficult = True else: class_name, left, top, right, bottom = line.split() except: if "difficult" in line: line_split = line.split() _difficult = line_split[-1] bottom = line_split[-2] right = line_split[-3] top = line_split[-4] left = line_split[-5] class_name = "" for name in line_split[:-5]: class_name += name + " " class_name = class_name[:-1] is_difficult = True else: line_split = line.split() bottom = line_split[-1] right = line_split[-2] top = line_split[-3] left = line_split[-4] class_name = "" for name in line_split[:-4]: class_name += name + " " class_name = class_name[:-1] if class_name in args.ignore: continue bbox = left + " " + top + " " + right + " " +bottom if is_difficult: bounding_boxes.append({"class_name":class_name, "bbox":bbox, "used":False, "difficult":True}) is_difficult = False else: bounding_boxes.append({"class_name":class_name, "bbox":bbox, "used":False}) if class_name in gt_counter_per_class: gt_counter_per_class[class_name] += 1 else: gt_counter_per_class[class_name] = 1
if class_name not in already_seen_classes: if class_name in counter_images_per_class: counter_images_per_class[class_name] += 1 else: counter_images_per_class[class_name] = 1 already_seen_classes.append(class_name)
with open(TEMP_FILES_PATH + "/" + file_id + "_ground_truth.json", 'w') as outfile: json.dump(bounding_boxes, outfile)
gt_classes = list(gt_counter_per_class.keys())gt_classes = sorted(gt_classes)n_classes = len(gt_classes)
""" Check format of the flag --set-class-iou (if used) e.g. check if class exists"""if specific_iou_flagged: n_args = len(args.set_class_iou) error_msg = \ '\n --set-class-iou [class_1] [IoU_1] [class_2] [IoU_2] [...]' if n_args % 2 != 0: error('Error, missing arguments. Flag usage:' + error_msg) # [class_1] [IoU_1] [class_2] [IoU_2] # specific_iou_classes = ['class_1', 'class_2'] specific_iou_classes = args.set_class_iou[::2] # even # iou_list = ['IoU_1', 'IoU_2'] iou_list = args.set_class_iou[1::2] # odd if len(specific_iou_classes) != len(iou_list): error('Error, missing arguments. Flag usage:' + error_msg) for tmp_class in specific_iou_classes: if tmp_class not in gt_classes: error('Error, unknown class \"' + tmp_class + '\". Flag usage:' + error_msg) for num in iou_list: if not is_float_between_0_and_1(num): error('Error, IoU must be between 0.0 and 1.0. Flag usage:' + error_msg)
""" detection-results Load each of the detection-results files into a temporary ".json" file."""dr_files_list = glob.glob(DR_PATH + '/*.txt')dr_files_list.sort()
for class_index, class_name in enumerate(gt_classes): bounding_boxes = [] for txt_file in dr_files_list: file_id = txt_file.split(".txt",1)[0] file_id = os.path.basename(os.path.normpath(file_id)) temp_path = os.path.join(GT_PATH, (file_id + ".txt")) if class_index == 0: if not os.path.exists(temp_path): error_msg = "Error. File not found: {}\n".format(temp_path) error_msg += "(You can avoid this error message by running extra/intersect-gt-and-dr.py)" error(error_msg) lines = file_lines_to_list(txt_file) for line in lines: try: tmp_class_name, confidence, left, top, right, bottom = line.split() except: line_split = line.split() bottom = line_split[-1] right = line_split[-2] top = line_split[-3] left = line_split[-4] confidence = line_split[-5] tmp_class_name = "" for name in line_split[:-5]: tmp_class_name += name + " " tmp_class_name = tmp_class_name[:-1]
if tmp_class_name == class_name: bbox = left + " " + top + " " + right + " " +bottom bounding_boxes.append({"confidence":confidence, "file_id":file_id, "bbox":bbox})
bounding_boxes.sort(key=lambda x:float(x['confidence']), reverse=True) with open(TEMP_FILES_PATH + "/" + class_name + "_dr.json", 'w') as outfile: json.dump(bounding_boxes, outfile)
""" Calculate the AP for each class"""sum_AP = 0.0ap_dictionary = {}lamr_dictionary = {}with open(results_files_path + "/results.txt", 'w') as results_file: results_file.write("# AP and precision/recall per class\n") count_true_positives = {}
for class_index, class_name in enumerate(gt_classes): count_true_positives[class_name] = 0 """ Load detection-results of that class """ dr_file = TEMP_FILES_PATH + "/" + class_name + "_dr.json" dr_data = json.load(open(dr_file)) """ Assign detection-results to ground-truth objects """ nd = len(dr_data) tp = [0] * nd fp = [0] * nd score = [0] * nd score05_idx = 0 for idx, detection in enumerate(dr_data): file_id = detection["file_id"] score[idx] = float(detection["confidence"]) if score[idx] > 0.5: score05_idx = idx
if show_animation: ground_truth_img = glob.glob1(IMG_PATH, file_id + ".*") if len(ground_truth_img) == 0: error("Error. Image not found with id: " + file_id) elif len(ground_truth_img) > 1: error("Error. Multiple image with id: " + file_id) else: img = cv2.imread(IMG_PATH + "/" + ground_truth_img[0]) img_cumulative_path = results_files_path + "/images/" + ground_truth_img[0] if os.path.isfile(img_cumulative_path): img_cumulative = cv2.imread(img_cumulative_path) else: img_cumulative = img.copy() bottom_border = 60 BLACK = [0, 0, 0] img = cv2.copyMakeBorder(img, 0, bottom_border, 0, 0, cv2.BORDER_CONSTANT, value=BLACK)
gt_file = TEMP_FILES_PATH + "/" + file_id + "_ground_truth.json" ground_truth_data = json.load(open(gt_file)) ovmax = -1 gt_match = -1 bb = [ float(x) for x in detection["bbox"].split() ] for obj in ground_truth_data: if obj["class_name"] == class_name: bbgt = [ float(x) for x in obj["bbox"].split() ] bi = [max(bb[0],bbgt[0]), max(bb[1],bbgt[1]), min(bb[2],bbgt[2]), min(bb[3],bbgt[3])] iw = bi[2] - bi[0] + 1 ih = bi[3] - bi[1] + 1 if iw > 0 and ih > 0: # compute overlap (IoU) = area of intersection / area of union ua = (bb[2] - bb[0] + 1) * (bb[3] - bb[1] + 1) + (bbgt[2] - bbgt[0] + 1) * (bbgt[3] - bbgt[1] + 1) - iw * ih ov = iw * ih / ua if ov > ovmax: ovmax = ov gt_match = obj
if show_animation: status = "NO MATCH FOUND!" min_overlap = MINOVERLAP if specific_iou_flagged: if class_name in specific_iou_classes: index = specific_iou_classes.index(class_name) min_overlap = float(iou_list[index]) if ovmax >= min_overlap: if "difficult" not in gt_match: if not bool(gt_match["used"]): tp[idx] = 1 gt_match["used"] = True count_true_positives[class_name] += 1 with open(gt_file, 'w') as f: f.write(json.dumps(ground_truth_data)) if show_animation: status = "MATCH!" else: fp[idx] = 1 if show_animation: status = "REPEATED MATCH!" else: fp[idx] = 1 if ovmax > 0: status = "INSUFFICIENT OVERLAP"
""" Draw image to show animation """ if show_animation: height, widht = img.shape[:2] # colors (OpenCV works with BGR) white = (255,255,255) light_blue = (255,200,100) green = (0,255,0) light_red = (30,30,255) # 1st line margin = 10 v_pos = int(height - margin - (bottom_border / 2.0)) text = "Image: " + ground_truth_img[0] + " " img, line_width = draw_text_in_image(img, text, (margin, v_pos), white, 0) text = "Class [" + str(class_index) + "/" + str(n_classes) + "]: " + class_name + " " img, line_width = draw_text_in_image(img, text, (margin + line_width, v_pos), light_blue, line_width) if ovmax != -1: color = light_red if status == "INSUFFICIENT OVERLAP": text = "IoU: {0:.2f}% ".format(ovmax*100) + "< {0:.2f}% ".format(min_overlap*100) else: text = "IoU: {0:.2f}% ".format(ovmax*100) + ">= {0:.2f}% ".format(min_overlap*100) color = green img, _ = draw_text_in_image(img, text, (margin + line_width, v_pos), color, line_width) # 2nd line v_pos += int(bottom_border / 2.0) rank_pos = str(idx+1) # rank position (idx starts at 0) text = "Detection #rank: " + rank_pos + " confidence: {0:.2f}% ".format(float(detection["confidence"])*100) img, line_width = draw_text_in_image(img, text, (margin, v_pos), white, 0) color = light_red if status == "MATCH!": color = green text = "Result: " + status + " " img, line_width = draw_text_in_image(img, text, (margin + line_width, v_pos), color, line_width)
font = cv2.FONT_HERSHEY_SIMPLEX if ovmax > 0: # if there is intersections between the bounding-boxes bbgt = [ int(round(float(x))) for x in gt_match["bbox"].split() ] cv2.rectangle(img,(bbgt[0],bbgt[1]),(bbgt[2],bbgt[3]),light_blue,2) cv2.rectangle(img_cumulative,(bbgt[0],bbgt[1]),(bbgt[2],bbgt[3]),light_blue,2) cv2.putText(img_cumulative, class_name, (bbgt[0],bbgt[1] - 5), font, 0.6, light_blue, 1, cv2.LINE_AA) bb = [int(i) for i in bb] cv2.rectangle(img,(bb[0],bb[1]),(bb[2],bb[3]),color,2) cv2.rectangle(img_cumulative,(bb[0],bb[1]),(bb[2],bb[3]),color,2) cv2.putText(img_cumulative, class_name, (bb[0],bb[1] - 5), font, 0.6, color, 1, cv2.LINE_AA) # show image cv2.imshow("Animation", img) cv2.waitKey(20) # show for 20 ms # save image to results output_img_path = results_files_path + "/images/detections_one_by_one/" + class_name + "_detection" + str(idx) + ".jpg" cv2.imwrite(output_img_path, img) # save the image with all the objects drawn to it cv2.imwrite(img_cumulative_path, img_cumulative)
cumsum = 0 for idx, val in enumerate(fp): fp[idx] += cumsum cumsum += val
cumsum = 0 for idx, val in enumerate(tp): tp[idx] += cumsum cumsum += val
rec = tp[:] for idx, val in enumerate(tp): rec[idx] = float(tp[idx]) / np.maximum(gt_counter_per_class[class_name], 1)
prec = tp[:] for idx, val in enumerate(tp): prec[idx] = float(tp[idx]) / np.maximum((fp[idx] + tp[idx]), 1)
ap, mrec, mprec = voc_ap(rec[:], prec[:]) F1 = np.array(rec)*np.array(prec)*2 / np.where((np.array(prec)+np.array(rec))==0, 1, (np.array(prec)+np.array(rec)))
sum_AP += ap text = "{0:.2f}%".format(ap*100) + " = " + class_name + " AP " #class_name + " AP = {0:.2f}%".format(ap*100)
if len(prec)>0: F1_text = "{0:.2f}".format(F1[score05_idx]) + " = " + class_name + " F1 " Recall_text = "{0:.2f}%".format(rec[score05_idx]*100) + " = " + class_name + " Recall " Precision_text = "{0:.2f}%".format(prec[score05_idx]*100) + " = " + class_name + " Precision " else: F1_text = "0.00" + " = " + class_name + " F1 " Recall_text = "0.00%" + " = " + class_name + " Recall " Precision_text = "0.00%" + " = " + class_name + " Precision "
rounded_prec = [ '%.2f' % elem for elem in prec ] rounded_rec = [ '%.2f' % elem for elem in rec ] results_file.write(text + "\n Precision: " + str(rounded_prec) + "\n Recall :" + str(rounded_rec) + "\n\n") if not args.quiet: if len(prec)>0: print(text + "\t||\tscore_threhold=0.5 : " + "F1=" + "{0:.2f}".format(F1[score05_idx])\ + " ; Recall=" + "{0:.2f}%".format(rec[score05_idx]*100) + " ; Precision=" + "{0:.2f}%".format(prec[score05_idx]*100)) else: print(text + "\t||\tscore_threhold=0.5 : F1=0.00% ; Recall=0.00% ; Precision=0.00%") ap_dictionary[class_name] = ap
n_images = counter_images_per_class[class_name] lamr, mr, fppi = log_average_miss_rate(np.array(rec), np.array(fp), n_images) lamr_dictionary[class_name] = lamr
""" Draw plot """ if draw_plot: plt.plot(rec, prec, '-o') area_under_curve_x = mrec[:-1] + [mrec[-2]] + [mrec[-1]] area_under_curve_y = mprec[:-1] + [0.0] + [mprec[-1]] plt.fill_between(area_under_curve_x, 0, area_under_curve_y, alpha=0.2, edgecolor='r')
fig = plt.gcf() fig.canvas.set_window_title('AP ' + class_name)
plt.title('class: ' + text) plt.xlabel('Recall') plt.ylabel('Precision') axes = plt.gca() axes.set_xlim([0.0,1.0]) axes.set_ylim([0.0,1.05]) fig.savefig(results_files_path + "/AP/" + class_name + ".png") plt.cla()
plt.plot(score, F1, "-", color='orangered') plt.title('class: ' + F1_text + "\nscore_threhold=0.5") plt.xlabel('Score_Threhold') plt.ylabel('F1') axes = plt.gca() axes.set_xlim([0.0,1.0]) axes.set_ylim([0.0,1.05]) fig.savefig(results_files_path + "/F1/" + class_name + ".png") plt.cla()
plt.plot(score, rec, "-H", color='gold') plt.title('class: ' + Recall_text + "\nscore_threhold=0.5") plt.xlabel('Score_Threhold') plt.ylabel('Recall') axes = plt.gca() axes.set_xlim([0.0,1.0]) axes.set_ylim([0.0,1.05]) fig.savefig(results_files_path + "/Recall/" + class_name + ".png") plt.cla()
plt.plot(score, prec, "-s", color='palevioletred') plt.title('class: ' + Precision_text + "\nscore_threhold=0.5") plt.xlabel('Score_Threhold') plt.ylabel('Precision') axes = plt.gca() axes.set_xlim([0.0,1.0]) axes.set_ylim([0.0,1.05]) fig.savefig(results_files_path + "/Precision/" + class_name + ".png") plt.cla() if show_animation: cv2.destroyAllWindows()
results_file.write("\n# mAP of all classes\n") mAP = sum_AP / n_classes text = "mAP = {0:.2f}%".format(mAP*100) results_file.write(text + "\n") print(text)
# remove the temp_files directoryshutil.rmtree(TEMP_FILES_PATH)
""" Count total of detection-results"""# iterate through all the filesdet_counter_per_class = {}for txt_file in dr_files_list: # get lines to list lines_list = file_lines_to_list(txt_file) for line in lines_list: class_name = line.split()[0] # check if class is in the ignore list, if yes skip if class_name in args.ignore: continue # count that object if class_name in det_counter_per_class: det_counter_per_class[class_name] += 1 else: # if class didn't exist yet det_counter_per_class[class_name] = 1#print(det_counter_per_class)dr_classes = list(det_counter_per_class.keys())
""" Plot the total number of occurences of each class in the ground-truth"""if draw_plot: window_title = "ground-truth-info" plot_title = "ground-truth\n" plot_title += "(" + str(len(ground_truth_files_list)) + " files and " + str(n_classes) + " classes)" x_label = "Number of objects per class" output_path = results_files_path + "/ground-truth-info.png" to_show = False plot_color = 'forestgreen' draw_plot_func( gt_counter_per_class, n_classes, window_title, plot_title, x_label, output_path, to_show, plot_color, '', )
""" Write number of ground-truth objects per class to results.txt"""with open(results_files_path + "/results.txt", 'a') as results_file: results_file.write("\n# Number of ground-truth objects per class\n") for class_name in sorted(gt_counter_per_class): results_file.write(class_name + ": " + str(gt_counter_per_class[class_name]) + "\n")
""" Finish counting true positives"""for class_name in dr_classes: # if class exists in detection-result but not in ground-truth then there are no true positives in that class if class_name not in gt_classes: count_true_positives[class_name] = 0#print(count_true_positives)
""" Plot the total number of occurences of each class in the "detection-results" folder"""if draw_plot: window_title = "detection-results-info" # Plot title plot_title = "detection-results\n" plot_title += "(" + str(len(dr_files_list)) + " files and " count_non_zero_values_in_dictionary = sum(int(x) > 0 for x in list(det_counter_per_class.values())) plot_title += str(count_non_zero_values_in_dictionary) + " detected classes)" # end Plot title x_label = "Number of objects per class" output_path = results_files_path + "/detection-results-info.png" to_show = False plot_color = 'forestgreen' true_p_bar = count_true_positives draw_plot_func( det_counter_per_class, len(det_counter_per_class), window_title, plot_title, x_label, output_path, to_show, plot_color, true_p_bar )
""" Write number of detected objects per class to results.txt"""with open(results_files_path + "/results.txt", 'a') as results_file: results_file.write("\n# Number of detected objects per class\n") for class_name in sorted(dr_classes): n_det = det_counter_per_class[class_name] text = class_name + ": " + str(n_det) text += " (tp:" + str(count_true_positives[class_name]) + "" text += ", fp:" + str(n_det - count_true_positives[class_name]) + ")\n" results_file.write(text)
""" Draw log-average miss rate plot (Show lamr of all classes in decreasing order)"""if draw_plot: window_title = "lamr" plot_title = "log-average miss rate" x_label = "log-average miss rate" output_path = results_files_path + "/lamr.png" to_show = False plot_color = 'royalblue' draw_plot_func( lamr_dictionary, n_classes, window_title, plot_title, x_label, output_path, to_show, plot_color, "" )
""" Draw mAP plot (Show AP's of all classes in decreasing order)"""if draw_plot: window_title = "mAP" plot_title = "mAP = {0:.2f}%".format(mAP*100) x_label = "Average Precision" output_path = results_files_path + "/mAP.png" to_show = True plot_color = 'royalblue' draw_plot_func( ap_dictionary, n_classes, window_title, plot_title, x_label, output_path, to_show, plot_color, "" )123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407import globimport jsonimport osimport shutilimport operatorimport sysimport argparseimport mathimport matplotlib.pyplot as plt import numpy as np
MINOVERLAP = 0.5GT_PATH = os.path.join(os.getcwd(), 'finalinput', 'ground-truth')DR_PATH = os.path.join(os.getcwd(), 'finalinput', 'detection-results')
def file_lines_to_list(path): # open txt file lines to a list with open(path) as f: content = f.readlines() # remove whitespace characters like `\n` at the end of each line content = [x.strip() for x in content] return content
ground_truth_files_list = glob.glob(GT_PATH + '/*.txt')# if len(ground_truth_files_list) == 0:# error("Error: No ground-truth files found!")ground_truth_files_list.sort()# dictionary with counter per classgt_counter_per_class = {}counter_images_per_class = {}
TEMP_FILES_PATH = ".temp_files"if not os.path.exists(TEMP_FILES_PATH): # if it doesn't exist already os.makedirs(TEMP_FILES_PATH)results_files_path = "results"if os.path.exists(results_files_path): # if it exist already # reset the results directory shutil.rmtree(results_files_path)
os.makedirs(results_files_path)gt_counter_per_size={}
for txt_file in ground_truth_files_list: #print(txt_file) file_id = txt_file.split(".txt", 1)[0] file_id = os.path.basename(os.path.normpath(file_id)) # check if there is a correspondent detection-results file temp_path = os.path.join(DR_PATH, (file_id + ".txt")) lines_list = file_lines_to_list(txt_file) # create ground-truth dictionary bounding_boxes = [] is_difficult = False already_seen_classes = [] for line in lines_list: try: if "difficult" in line: class_name, left, top, right, bottom, _difficult = line.split() is_difficult = True else: class_name, left, top, right, bottom = line.split() except: if "difficult" in line: line_split = line.split() _difficult = line_split[-1] bottom = line_split[-2] right = line_split[-3] top = line_split[-4] left = line_split[-5] class_name = "" for name in line_split[:-5]: class_name += name + " " class_name = class_name[:-1] is_difficult = True else: line_split = line.split() bottom = line_split[-1] right = line_split[-2] top = line_split[-3] left = line_split[-4] class_name = "" for name in line_split[:-4]: class_name += name + " " class_name = class_name[:-1]
length=int(bottom)-int(top) width=int(right)-int(left) if length<0: length=-length if width<0: width=-width size="" if length>576 or width>324: size="super" elif length>384 or width>216: size="big" elif length>192 or width>108: size="mid" else: size="small" bbox = left + " " + top + " " + right + " " +bottom if is_difficult: bounding_boxes.append({"class_name":class_name, "bbox":bbox, "used":False, "difficult":True,"size":size}) is_difficult = False else: bounding_boxes.append({"class_name":class_name, "bbox":bbox, "used":False,"size":size}) if class_name in gt_counter_per_class: gt_counter_per_class[class_name] += 1 else: gt_counter_per_class[class_name] = 1 if size in gt_counter_per_size: gt_counter_per_size[size] += 1 else: gt_counter_per_size[size] = 1 if class_name not in already_seen_classes: if class_name in counter_images_per_class: counter_images_per_class[class_name] += 1 else: counter_images_per_class[class_name] = 1 already_seen_classes.append(class_name)
with open(TEMP_FILES_PATH + "/" + file_id + "_ground_truth.json", 'w') as outfile: json.dump(bounding_boxes, outfile)
gt_classes = list(gt_counter_per_class.keys())gt_classes = sorted(gt_classes)n_classes = len(gt_classes)
dr_files_list = glob.glob(DR_PATH + '/*.txt')dr_files_list.sort()
for class_index, class_name in enumerate(gt_classes): bounding_boxes = [] for txt_file in dr_files_list: file_id = txt_file.split(".txt",1)[0] file_id = os.path.basename(os.path.normpath(file_id)) temp_path = os.path.join(GT_PATH, (file_id + ".txt")) if class_index == 0: if not os.path.exists(temp_path): error_msg = "Error. File not found: {}\n".format(temp_path) error_msg += "(You can avoid this error message by running extra/intersect-gt-and-dr.py)" error(error_msg) lines = file_lines_to_list(txt_file) for line in lines: try: tmp_class_name, confidence, left, top, right, bottom = line.split() except: line_split = line.split() bottom = line_split[-1] right = line_split[-2] top = line_split[-3] left = line_split[-4] confidence = line_split[-5] tmp_class_name = "" for name in line_split[:-5]: tmp_class_name += name + " " tmp_class_name = tmp_class_name[:-1]
if tmp_class_name == class_name: bbox = left + " " + top + " " + right + " " +bottom bounding_boxes.append({"confidence":confidence, "file_id":file_id, "bbox":bbox})
bounding_boxes.sort(key=lambda x:float(x['confidence']), reverse=True) with open(TEMP_FILES_PATH + "/" + class_name + "_dr.json", 'w') as outfile: json.dump(bounding_boxes, outfile)
show_animation=Falsespecific_iou_flagged=Falsequiet=Falsedraw_plot=Trueap_dict={}
def draw_text_in_image(img, text, pos, color, line_width): font = cv2.FONT_HERSHEY_PLAIN fontScale = 1 lineType = 1 bottomLeftCornerOfText = pos cv2.putText(img, text, bottomLeftCornerOfText, font, fontScale, color, lineType) text_width, _ = cv2.getTextSize(text, font, fontScale, lineType)[0] return img, (line_width + text_width)
""" Plot - adjust axes"""
def voc_ap(rec, prec): """ --- Official matlab code VOC2012--- mrec=[0 ; rec ; 1]; mpre=[0 ; prec ; 0]; for i=numel(mpre)-1:-1:1 mpre(i)=max(mpre(i),mpre(i+1)); end i=find(mrec(2:end)~=mrec(1:end-1))+1; ap=sum((mrec(i)-mrec(i-1)).*mpre(i)); """ rec.insert(0, 0.0) # insert 0.0 at begining of list rec.append(1.0) # insert 1.0 at end of list mrec = rec[:] prec.insert(0, 0.0) # insert 0.0 at begining of list prec.append(0.0) # insert 0.0 at end of list mpre = prec[:] """ This part makes the precision monotonically decreasing (goes from the end to the beginning) matlab: for i=numel(mpre)-1:-1:1 mpre(i)=max(mpre(i),mpre(i+1)); """ for i in range(len(mpre)-2, -1, -1): mpre[i] = max(mpre[i], mpre[i+1]) """ This part creates a list of indexes where the recall changes matlab: i=find(mrec(2:end)~=mrec(1:end-1))+1; """ i_list = [] for i in range(1, len(mrec)): if mrec[i] != mrec[i-1]: i_list.append(i) # if it was matlab would be i + 1 """ The Average Precision (AP) is the area under the curve (numerical integration) matlab: ap=sum((mrec(i)-mrec(i-1)).*mpre(i)); """ ap = 0.0 for i in i_list: ap += ((mrec[i]-mrec[i-1])*mpre[i]) return ap, mrec, mpre
count_true_positives_size={'super':[],'big':[],'mid':[],'small':[]}
""" Calculate the AP for each class"""sum_AP = 0.0ap_dictionary = {}lamr_dictionary = {}with open(results_files_path + "/results.txt", 'w') as results_file: results_file.write("# AP and precision/recall per class\n") count_true_positives = {}
for class_index, class_name in enumerate(gt_classes): count_true_positives[class_name] = 0 """ Load detection-results of that class """ dr_file = TEMP_FILES_PATH + "/" + class_name + "_dr.json" dr_data = json.load(open(dr_file)) """ Assign detection-results to ground-truth objects """ nd = len(dr_data) tp = [0] * nd fp = [0] * nd score = [0] * nd score05_idx = 0 for idx, detection in enumerate(dr_data): file_id = detection["file_id"] score[idx] = float(detection["confidence"]) if score[idx] > 0.5: score05_idx = idx
gt_file = TEMP_FILES_PATH + "/" + file_id + "_ground_truth.json" ground_truth_data = json.load(open(gt_file)) ovmax = -1 gmatch = -1 bb = [ float(x) for x in detection["bbox"].split() ] for obj in ground_truth_data: if obj["class_name"] == class_name: bbgt = [ float(x) for x in obj["bbox"].split() ] bi = [max(bb[0],bbgt[0]), max(bb[1],bbgt[1]), min(bb[2],bbgt[2]), min(bb[3],bbgt[3])] iw = bi[2] - bi[0] + 1 ih = bi[3] - bi[1] + 1 if iw > 0 and ih > 0: # compute overlap (IoU) = area of intersection / area of union ua = (bb[2] - bb[0] + 1) * (bb[3] - bb[1] + 1) + (bbgt[2] - bbgt[0] + 1) * (bbgt[3] - bbgt[1] + 1) - iw * ih ov = iw * ih / ua if ov > ovmax: ovmax = ov gt_match = obj
min_overlap = MINOVERLAP if specific_iou_flagged: if class_name in specific_iou_classes: index = specific_iou_classes.index(class_name) min_overlap = float(iou_list[index]) if ovmax >= min_overlap: if "difficult" not in gt_match: if not bool(gt_match["used"]): tp[idx] = 1 gt_match["used"] = True count_true_positives[class_name] += 1 tmp_list=count_true_positives_size[gt_match['size']] tmp_list.append(1) count_true_positives_size[gt_match['size']]=tmp_list with open(gt_file, 'w') as f: f.write(json.dumps(ground_truth_data)) if show_animation: status = "MATCH!" else: fp[idx] = 1 tmp_list=count_true_positives_size[gt_match['size']] tmp_list.append(0) count_true_positives_size[gt_match['size']]=tmp_list if show_animation: status = "REPEATED MATCH!" else: fp[idx] = 1 tmp_list=count_true_positives_size[gt_match['size']] tmp_list.append(0) count_true_positives_size[gt_match['size']]=tmp_list if ovmax > 0: status = "INSUFFICIENT OVERLAP"
cumsum = 0 for idx, val in enumerate(fp): fp[idx] += cumsum cumsum += val
cumsum = 0 for idx, val in enumerate(tp): tp[idx] += cumsum cumsum += val
rec = tp[:] for idx, val in enumerate(tp): rec[idx] = float(tp[idx]) / np.maximum(gt_counter_per_class[class_name], 1)
prec = tp[:] for idx, val in enumerate(tp): prec[idx] = float(tp[idx]) / np.maximum((fp[idx] + tp[idx]), 1)
ap, mrec, mprec = voc_ap(rec[:], prec[:])# F1 = np.array(rec)*np.array(prec)*2 / np.where((np.array(prec)+np.array(rec))==0, 1, (np.array(prec)+np.array(rec))) F1=0 sum_AP += ap text = "{0:.2f}%".format(ap*100) + " = " + class_name + " AP " #class_name + " AP = {0:.2f}%".format(ap*100)
# if len(prec)>0:# F1_text = "{0:.2f}".format(F1[score05_idx]) + " = " + class_name + " F1 "# Recall_text = "{0:.2f}%".format(rec[score05_idx]*100) + " = " + class_name + " Recall "# Precision_text = "{0:.2f}%".format(prec[score05_idx]*100) + " = " + class_name + " Precision "# else:# F1_text = "0.00" + " = " + class_name + " F1 " # Recall_text = "0.00%" + " = " + class_name + " Recall " # Precision_text = "0.00%" + " = " + class_name + " Precision "
# rounded_prec = [ '%.2f' % elem for elem in prec ]# rounded_rec = [ '%.2f' % elem for elem in rec ]# results_file.write(text + "\n Precision: " + str(rounded_prec) + "\n Recall :" + str(rounded_rec) + "\n\n")# if not quiet:# if len(prec)>0:# print(text + "\t||\tscore_threhold=0.5 : " + "F1=" + "{0:.2f}".format(F1[score05_idx])\# + " ; Recall=" + "{0:.2f}%".format(rec[score05_idx]*100) + " ; Precision=" + "{0:.2f}%".format(prec[score05_idx]*100))# else:# print(text + "\t||\tscore_threhold=0.5 : F1=0.00% ; Recall=0.00% ; Precision=0.00%") ap_dictionary[class_name] = ap
# n_images = counter_images_per_class[class_name]# lamr, mr, fppi = log_average_miss_rate(np.array(rec), np.array(fp), n_images)# lamr_dictionary[class_name] = lamr
for i in gt_counter_per_size.keys(): tp=[] for k in count_true_positives_size[i]: tp.append(k) fp=[] for j in tp: if j==1: fp.append(0) if j==0: fp.append(1) cumsum = 0 for idx, val in enumerate(fp): fp[idx] += cumsum cumsum += val cumsum = 0 for idx, val in enumerate(tp): tp[idx] += cumsum cumsum += val
rec = tp[:] for idx, val in enumerate(tp): rec[idx] = float(tp[idx]) / np.maximum(gt_counter_per_size[i], 1)
prec = tp[:] for idx, val in enumerate(tp): prec[idx] = float(tp[idx]) / np.maximum((fp[idx] + tp[idx]), 1) ap, mrec, mprec = voc_ap(rec[:], prec[:]) ap_dict[i]=ap
print(ap_dict)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111import globimport randomimport xml.etree.ElementTree as ET
import numpy as np
def cas_iou(box,cluster): x = np.minimum(cluster[:,0],box[0]) y = np.minimum(cluster[:,1],box[1])
intersection = x * y area1 = box[0] * box[1]
area2 = cluster[:,0] * cluster[:,1] iou = intersection / (area1 + area2 -intersection)
return iou
def avg_iou(box,cluster): return np.mean([np.max(cas_iou(box[i],cluster)) for i in range(box.shape[0])])
def kmeans(box,k): # 取出一共有多少框 row = box.shape[0] # 每个框各个点的位置 distance = np.empty((row,k)) # 最后的聚类位置 last_clu = np.zeros((row,))
np.random.seed()
# 随机选5个当聚类中心 cluster = box[np.random.choice(row,k,replace = False)] # cluster = random.sample(row, k) while True: # 计算每一行距离五个点的iou情况。 for i in range(row): distance[i] = 1 - cas_iou(box[i],cluster) # 取出最小点 near = np.argmin(distance,axis=1)
if (last_clu == near).all(): break # 求每一个类的中位点 for j in range(k): cluster[j] = np.median( box[near == j],axis=0)
last_clu = near
return cluster
def load_data(path): data = [] # 对于每一个xml都寻找box for xml_file in glob.glob('{}/*xml'.format(path)): tree = ET.parse(xml_file) height = int(tree.findtext('./size/height')) width = int(tree.findtext('./size/width')) if height<=0 or width<=0: continue # 对于每一个目标都获得它的宽高 for obj in tree.iter('object'): xmin = int(float(obj.findtext('bndbox/xmin'))) / width ymin = int(float(obj.findtext('bndbox/ymin'))) / height xmax = int(float(obj.findtext('bndbox/xmax'))) / width ymax = int(float(obj.findtext('bndbox/ymax'))) / height
xmin = np.float64(xmin) ymin = np.float64(ymin) xmax = np.float64(xmax) ymax = np.float64(ymax) # 得到宽高 data.append([xmax-xmin,ymax-ymin]) return np.array(data)
if __name__ == '__main__': # 运行该程序会计算'./VOCdevkit/VOC2007/Annotations'的xml # 会生成yolo_anchors.txt SIZE = 512 anchors_num = 15 # 载入数据集,可以使用VOC的xml path = r'./VOCdevkit/VOC2007/Annotations' # 载入所有的xml # 存储格式为转化为比例后的width,height data = load_data(path) # 使用k聚类算法 out = kmeans(data,anchors_num) out = out[np.argsort(out[:,0])] print('acc:{:.2f}%'.format(avg_iou(data,out) * 100)) print(out*SIZE) data = out*SIZE f = open("yolo_anchors.txt", 'w') row = np.shape(data)[0] for i in range(row): if i == 0: x_y = "%d,%d" % (data[i][0], data[i][1]) else: x_y = ", %d,%d" % (data[i][0], data[i][1]) f.write(x_y) f.close()1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980personbicyclecarmotorbikeaeroplanebustraintruckboattraffic lightfire hydrantstop signparking meterbenchbirdcatdoghorsesheepcowelephantbearzebragiraffebackpackumbrellahandbagtiesuitcasefrisbeeskissnowboardsports ballkitebaseball batbaseball gloveskateboardsurfboardtennis racketbottlewine glasscupforkknifespoonbowlbananaapplesandwichorangebroccolicarrothot dogpizzadonutcakechairsofapottedplantbeddiningtabletoilettvmonitorlaptopmouseremotekeyboardcell phonemicrowaveoventoastersinkrefrigeratorbookclockvasescissorsteddy bearhair driertoothbrush123456789cruiseshipferryboatfreightboatgondolainflatableboatkayakpaperboatsailboatbuoy120,25, 34,83, 50,37, 52,240, 71,133, 94,42, 100,283, 101,76, 157,169, 186,73, 232,372, 306,114, 383,183, 408,313, 477,476123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179import mathfrom collections import OrderedDict
import torchimport torch.nn as nnimport torch.nn.functional as F
#-------------------------------------------------## MISH激活函数#-------------------------------------------------#class Mish(nn.Module): def __init__(self): super(Mish, self).__init__()
def forward(self, x): return x * torch.tanh(F.softplus(x))
#---------------------------------------------------## 卷积块 -> 卷积 + 标准化 + 激活函数# Conv2d + BatchNormalization + Mish#---------------------------------------------------#class BasicConv(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1): super(BasicConv, self).__init__()
self.conv = nn.Conv2d(in_channels, out_channels, kernel_size, stride, kernel_size//2, bias=False) self.bn = nn.BatchNorm2d(out_channels) self.activation = Mish()
def forward(self, x): x = self.conv(x) x = self.bn(x) x = self.activation(x) return x
#---------------------------------------------------## CSPdarknet的结构块的组成部分# 内部堆叠的残差块#---------------------------------------------------#class Resblock(nn.Module): def __init__(self, channels, hidden_channels=None): super(Resblock, self).__init__()
if hidden_channels is None: hidden_channels = channels
self.block = nn.Sequential( BasicConv(channels, hidden_channels, 1), BasicConv(hidden_channels, channels, 3) )
def forward(self, x): return x + self.block(x)
#--------------------------------------------------------------------## CSPdarknet的结构块# 首先利用ZeroPadding2D和一个步长为2x2的卷积块进行高和宽的压缩# 然后建立一个大的残差边shortconv、这个大残差边绕过了很多的残差结构# 主干部分会对num_blocks进行循环,循环内部是残差结构。# 对于整个CSPdarknet的结构块,就是一个大残差块+内部多个小残差块#--------------------------------------------------------------------#class Resblock_body(nn.Module): def __init__(self, in_channels, out_channels, num_blocks, first): super(Resblock_body, self).__init__() #----------------------------------------------------------------# # 利用一个步长为2x2的卷积块进行高和宽的压缩 #----------------------------------------------------------------# self.downsample_conv = BasicConv(in_channels, out_channels, 3, stride=2)
if first: #--------------------------------------------------------------------------# # 然后建立一个大的残差边self.split_conv0、这个大残差边绕过了很多的残差结构 #--------------------------------------------------------------------------# self.split_conv0 = BasicConv(out_channels, out_channels, 1)
#----------------------------------------------------------------# # 主干部分会对num_blocks进行循环,循环内部是残差结构。 #----------------------------------------------------------------# self.split_conv1 = BasicConv(out_channels, out_channels, 1) self.blocks_conv = nn.Sequential( Resblock(channels=out_channels, hidden_channels=out_channels//2), BasicConv(out_channels, out_channels, 1) )
self.concat_conv = BasicConv(out_channels*2, out_channels, 1) else: #--------------------------------------------------------------------------# # 然后建立一个大的残差边self.split_conv0、这个大残差边绕过了很多的残差结构 #--------------------------------------------------------------------------# self.split_conv0 = BasicConv(out_channels, out_channels//2, 1)
#----------------------------------------------------------------# # 主干部分会对num_blocks进行循环,循环内部是残差结构。 #----------------------------------------------------------------# self.split_conv1 = BasicConv(out_channels, out_channels//2, 1) self.blocks_conv = nn.Sequential( *[Resblock(out_channels//2) for _ in range(num_blocks)], BasicConv(out_channels//2, out_channels//2, 1) )
self.concat_conv = BasicConv(out_channels, out_channels, 1)
def forward(self, x): x = self.downsample_conv(x)
x0 = self.split_conv0(x)
x1 = self.split_conv1(x) x1 = self.blocks_conv(x1)
#------------------------------------# # 将大残差边再堆叠回来 #------------------------------------# x = torch.cat([x1, x0], dim=1) #------------------------------------# # 最���对通道数进行整合 #------------------------------------# x = self.concat_conv(x)
return x
#---------------------------------------------------## CSPdarknet53 的主体部分# 输入为一张416x416x3的图片# 输出为三个有效特征层#---------------------------------------------------#class CSPDarkNet(nn.Module): def __init__(self, layers): super(CSPDarkNet, self).__init__() self.inplanes = 32 # 416,416,3 -> 416,416,32 self.conv1 = BasicConv(3, self.inplanes, kernel_size=3, stride=1) self.feature_channels = [64, 128, 256, 512, 1024, 2048]
self.stages = nn.ModuleList([ # 416,416,32 -> 208,208,64 Resblock_body(self.inplanes, self.feature_channels[0], layers[0], first=True), # 208,208,64 -> 104,104,128 Resblock_body(self.feature_channels[0], self.feature_channels[1], layers[1], first=False), # 104,104,128 -> 52,52,256 Resblock_body(self.feature_channels[1], self.feature_channels[2], layers[2], first=False), # 52,52,256 -> 26,26,512 Resblock_body(self.feature_channels[2], self.feature_channels[3], layers[3], first=False), # 26,26,512 -> 13,13,1024 Resblock_body(self.feature_channels[3], self.feature_channels[4], layers[4], first=False), Resblock_body(self.feature_channels[4], self.feature_channels[5], layers[5], first=False) ])
self.num_features = 1 for m in self.modules(): if isinstance(m, nn.Conv2d): n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels m.weight.data.normal_(0, math.sqrt(2. / n)) elif isinstance(m, nn.BatchNorm2d): m.weight.data.fill_(1) m.bias.data.zero_()
def forward(self, x): x = self.conv1(x)
out1 = self.stages[0](x) out2 = self.stages[1](out1) out3 = self.stages[2](out2) out4 = self.stages[3](out3) out5 = self.stages[4](out4) out6 = self.stages[5](out5)
return out1, out2, out3, out4, out5, out6
def darknet53(pretrained, **kwargs): model = CSPDarkNet([1, 2, 8, 8, 4, 2]) if pretrained: if isinstance(pretrained, str): model.load_state_dict(torch.load(pretrained)) else: raise Exception("darknet request a pretrained path. got [{}]".format(pretrained)) return model123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369import collectionsimport mathimport refrom functools import partial
import torchfrom torch import nnfrom torch.nn import functional as Ffrom torch.utils import model_zoo
#--------------------------------------------------------------## 模型构建的辅助函数#--------------------------------------------------------------#
GlobalParams = collections.namedtuple('GlobalParams', [ 'batch_norm_momentum', 'batch_norm_epsilon', 'dropout_rate', 'num_classes', 'width_coefficient', 'depth_coefficient', 'depth_divisor', 'min_depth', 'drop_connect_rate', 'image_size'])
BlockArgs = collections.namedtuple('BlockArgs', [ 'kernel_size', 'num_repeat', 'input_filters', 'output_filters', 'expand_ratio', 'id_skip', 'stride', 'se_ratio'])
GlobalParams.__new__.__defaults__ = (None,) * len(GlobalParams._fields)BlockArgs.__new__.__defaults__ = (None,) * len(BlockArgs._fields)
def round_filters(filters, global_params): """ Calculate and round number of filters based on depth multiplier. """ multiplier = global_params.width_coefficient if not multiplier: return filters divisor = global_params.depth_divisor min_depth = global_params.min_depth filters *= multiplier min_depth = min_depth or divisor new_filters = max(min_depth, int(filters + divisor / 2) // divisor * divisor) if new_filters < 0.9 * filters: # prevent rounding by more than 10% new_filters += divisor return int(new_filters)
def round_repeats(repeats, global_params): """ Round number of filters based on depth multiplier. """ multiplier = global_params.depth_coefficient if not multiplier: return repeats return int(math.ceil(multiplier * repeats))
def drop_connect(inputs, p, training): """ Drop connect. """ if not training: return inputs batch_size = inputs.shape[0] keep_prob = 1 - p random_tensor = keep_prob random_tensor += torch.rand([batch_size, 1, 1, 1], dtype=inputs.dtype, device=inputs.device) binary_tensor = torch.floor(random_tensor) output = inputs / keep_prob * binary_tensor return output
def get_same_padding_conv2d(image_size=None): """ Chooses static padding if you have specified an image size, and dynamic padding otherwise. Static padding is necessary for ONNX exporting of models. """ if image_size is None: return Conv2dDynamicSamePadding else: return partial(Conv2dStaticSamePadding, image_size=image_size)
class Conv2dDynamicSamePadding(nn.Conv2d): """ 2D Convolutions like TensorFlow, for a dynamic image size """
def __init__(self, in_channels, out_channels, kernel_size, stride=1, dilation=1, groups=1, bias=True): super().__init__(in_channels, out_channels, kernel_size, stride, 0, dilation, groups, bias) self.stride = self.stride if len(self.stride) == 2 else [self.stride[0]] * 2
def forward(self, x): ih, iw = x.size()[-2:] kh, kw = self.weight.size()[-2:] sh, sw = self.stride oh, ow = math.ceil(ih / sh), math.ceil(iw / sw) pad_h = max((oh - 1) * self.stride[0] + (kh - 1) * self.dilation[0] + 1 - ih, 0) pad_w = max((ow - 1) * self.stride[1] + (kw - 1) * self.dilation[1] + 1 - iw, 0) if pad_h > 0 or pad_w > 0: x = F.pad(x, [pad_w // 2, pad_w - pad_w // 2, pad_h // 2, pad_h - pad_h // 2]) return F.conv2d(x, self.weight, self.bias, self.stride, self.padding, self.dilation, self.groups)
class Identity(nn.Module): def __init__(self, ): super(Identity, self).__init__()
def forward(self, input): return input
#--------------------------------------------------------------## 加载模型参数的辅助函数#--------------------------------------------------------------#def efficientnet_params(model_name): """ Map EfficientNet model name to parameter coefficients. """ params_dict = { # Coefficients: width,depth,res,dropout 'efficientnet-b0': (1.0, 1.0, 224, 0.2), 'efficientnet-b1': (1.0, 1.1, 240, 0.2), 'efficientnet-b2': (1.1, 1.2, 260, 0.3), 'efficientnet-b3': (1.2, 1.4, 300, 0.3), 'efficientnet-b4': (1.4, 1.8, 380, 0.4), 'efficientnet-b5': (1.6, 2.2, 456, 0.4), 'efficientnet-b6': (1.8, 2.6, 528, 0.5), 'efficientnet-b7': (2.0, 3.1, 600, 0.5), 'efficientnet-b8': (2.2, 3.6, 672, 0.5), 'efficientnet-l2': (4.3, 5.3, 800, 0.5), } return params_dict[model_name]
class BlockDecoder(object): """ Block Decoder for readability, straight from the official TensorFlow repository """
@staticmethod def _decode_block_string(block_string): """ Gets a block through a string notation of arguments. """ assert isinstance(block_string, str)
ops = block_string.split('_') options = {} for op in ops: splits = re.split(r'(\d.*)', op) if len(splits) >= 2: key, value = splits[:2] options[key] = value
# Check stride assert (('s' in options and len(options['s']) == 1) or (len(options['s']) == 2 and options['s'][0] == options['s'][1]))
return BlockArgs( kernel_size=int(options['k']), num_repeat=int(options['r']), input_filters=int(options['i']), output_filters=int(options['o']), expand_ratio=int(options['e']), id_skip=('noskip' not in block_string), se_ratio=float(options['se']) if 'se' in options else None, stride=[int(options['s'][0])])
@staticmethod def _encode_block_string(block): """Encodes a block to a string.""" args = [ 'r%d' % block.num_repeat, 'k%d' % block.kernel_size, 's%d%d' % (block.strides[0], block.strides[1]), 'e%s' % block.expand_ratio, 'i%d' % block.input_filters, 'o%d' % block.output_filters ] if 0 < block.se_ratio <= 1: args.append('se%s' % block.se_ratio) if block.id_skip is False: args.append('noskip') return '_'.join(args)
@staticmethod def decode(string_list): """ Decodes a list of string notations to specify blocks inside the network.
:param string_list: a list of strings, each string is a notation of block :return: a list of BlockArgs namedtuples of block args """ assert isinstance(string_list, list) blocks_args = [] for block_string in string_list: blocks_args.append(BlockDecoder._decode_block_string(block_string)) return blocks_args
@staticmethod def encode(blocks_args): """ Encodes a list of BlockArgs to a list of strings.
:param blocks_args: a list of BlockArgs namedtuples of block args :return: a list of strings, each string is a notation of block """ block_strings = [] for block in blocks_args: block_strings.append(BlockDecoder._encode_block_string(block)) return block_strings
def efficientnet(width_coefficient=None, depth_coefficient=None, dropout_rate=0.2, drop_connect_rate=0.2, image_size=None, num_classes=1000): """ Creates a efficientnet model. """
blocks_args = [ 'r1_k3_s11_e1_i32_o16_se0.25', 'r2_k3_s22_e6_i16_o24_se0.25', 'r2_k5_s22_e6_i24_o40_se0.25', 'r3_k3_s22_e6_i40_o80_se0.25', 'r3_k5_s11_e6_i80_o112_se0.25', 'r4_k5_s22_e6_i112_o192_se0.25', 'r1_k3_s11_e6_i192_o320_se0.25', ] blocks_args = BlockDecoder.decode(blocks_args)
global_params = GlobalParams( batch_norm_momentum=0.99, batch_norm_epsilon=1e-3, dropout_rate=dropout_rate, drop_connect_rate=drop_connect_rate, # data_format='channels_last', # removed, this is always true in PyTorch num_classes=num_classes, width_coefficient=width_coefficient, depth_coefficient=depth_coefficient, depth_divisor=8, min_depth=None, image_size=image_size, )
return blocks_args, global_params
def get_model_params(model_name, override_params): """ Get the block args and global params for a given model """ if model_name.startswith('efficientnet'): w, d, s, p = efficientnet_params(model_name) # note: all models have drop connect rate = 0.2 blocks_args, global_params = efficientnet( width_coefficient=w, depth_coefficient=d, dropout_rate=p, image_size=s) else: raise NotImplementedError('model name is not pre-defined: %s' % model_name) if override_params: # ValueError will be raised here if override_params has fields not included in global_params. global_params = global_params._replace(**override_params) return blocks_args, global_params
url_map = { 'efficientnet-b0': 'https://publicmodels.blob.core.windows.net/container/aa/efficientnet-b0-355c32eb.pth', 'efficientnet-b1': 'https://publicmodels.blob.core.windows.net/container/aa/efficientnet-b1-f1951068.pth', 'efficientnet-b2': 'https://publicmodels.blob.core.windows.net/container/aa/efficientnet-b2-8bb594d6.pth', 'efficientnet-b3': 'https://publicmodels.blob.core.windows.net/container/aa/efficientnet-b3-5fb5a3c3.pth', 'efficientnet-b4': 'https://publicmodels.blob.core.windows.net/container/aa/efficientnet-b4-6ed6700e.pth', 'efficientnet-b5': 'https://publicmodels.blob.core.windows.net/container/aa/efficientnet-b5-b6417697.pth', 'efficientnet-b6': 'https://publicmodels.blob.core.windows.net/container/aa/efficientnet-b6-c76e70fd.pth', 'efficientnet-b7': 'https://publicmodels.blob.core.windows.net/container/aa/efficientnet-b7-dcc49843.pth',}
url_map_advprop = { 'efficientnet-b0': 'https://publicmodels.blob.core.windows.net/container/advprop/efficientnet-b0-b64d5a18.pth', 'efficientnet-b1': 'https://publicmodels.blob.core.windows.net/container/advprop/efficientnet-b1-0f3ce85a.pth', 'efficientnet-b2': 'https://publicmodels.blob.core.windows.net/container/advprop/efficientnet-b2-6e9d97e5.pth', 'efficientnet-b3': 'https://publicmodels.blob.core.windows.net/container/advprop/efficientnet-b3-cdd7c0f4.pth', 'efficientnet-b4': 'https://publicmodels.blob.core.windows.net/container/advprop/efficientnet-b4-44fb3a87.pth', 'efficientnet-b5': 'https://publicmodels.blob.core.windows.net/container/advprop/efficientnet-b5-86493f6b.pth', 'efficientnet-b6': 'https://publicmodels.blob.core.windows.net/container/advprop/efficientnet-b6-ac80338e.pth', 'efficientnet-b7': 'https://publicmodels.blob.core.windows.net/container/advprop/efficientnet-b7-4652b6dd.pth', 'efficientnet-b8': 'https://publicmodels.blob.core.windows.net/container/advprop/efficientnet-b8-22a8fe65.pth',}
def load_pretrained_weights(model, model_name, load_fc=True, advprop=False): """ Loads pretrained weights, and downloads if loading for the first time. """ # AutoAugment or Advprop (different preprocessing) url_map_ = url_map_advprop if advprop else url_map state_dict = model_zoo.load_url(url_map_[model_name], map_location=torch.device('cpu')) # state_dict = torch.load('../../weights/backbone_efficientnetb0.pth') if load_fc: ret = model.load_state_dict(state_dict, strict=False) print(ret) else: state_dict.pop('_fc.weight') state_dict.pop('_fc.bias') res = model.load_state_dict(state_dict, strict=False) assert set(res.missing_keys) == set(['_fc.weight', '_fc.bias']), 'issue loading pretrained weights' print('Loaded pretrained weights for {}'.format(model_name))
class SwishImplementation(torch.autograd.Function): @staticmethod def forward(ctx, i): result = i * torch.sigmoid(i) ctx.save_for_backward(i) return result
@staticmethod def backward(ctx, grad_output): i = ctx.saved_variables[0] sigmoid_i = torch.sigmoid(i) return grad_output * (sigmoid_i * (1 + i * (1 - sigmoid_i)))
class MemoryEfficientSwish(nn.Module): def forward(self, x): return SwishImplementation.apply(x)
class Swish(nn.Module): def forward(self, x): return x * torch.sigmoid(x)
class Conv2dStaticSamePadding(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, bias=True, groups=1, dilation=1, **kwargs): super().__init__() self.conv = nn.Conv2d(in_channels, out_channels, kernel_size, stride=stride, bias=bias, groups=groups) self.stride = self.conv.stride self.kernel_size = self.conv.kernel_size self.dilation = self.conv.dilation
if isinstance(self.stride, int): self.stride = [self.stride] * 2 elif len(self.stride) == 1: self.stride = [self.stride[0]] * 2
if isinstance(self.kernel_size, int): self.kernel_size = [self.kernel_size] * 2 elif len(self.kernel_size) == 1: self.kernel_size = [self.kernel_size[0]] * 2
def forward(self, x): h, w = x.shape[-2:] extra_h = (math.ceil(w / self.stride[1]) - 1) * self.stride[1] - w + self.kernel_size[1] extra_v = (math.ceil(h / self.stride[0]) - 1) * self.stride[0] - h + self.kernel_size[0] left = extra_h // 2 right = extra_h - left top = extra_v // 2 bottom = extra_v - top
x = F.pad(x, [left, right, top, bottom])
x = self.conv(x) return x
class MaxPool2dStaticSamePadding(nn.Module): def __init__(self, *args, **kwargs): super().__init__() self.pool = nn.MaxPool2d(*args, **kwargs) self.stride = self.pool.stride self.kernel_size = self.pool.kernel_size
if isinstance(self.stride, int): self.stride = [self.stride] * 2 elif len(self.stride) == 1: self.stride = [self.stride[0]] * 2
if isinstance(self.kernel_size, int): self.kernel_size = [self.kernel_size] * 2 elif len(self.kernel_size) == 1: self.kernel_size = [self.kernel_size[0]] * 2
def forward(self, x): h, w = x.shape[-2:] extra_h = (math.ceil(w / self.stride[1]) - 1) * self.stride[1] - w + self.kernel_size[1] extra_v = (math.ceil(h / self.stride[0]) - 1) * self.stride[0] - h + self.kernel_size[0]
left = extra_h // 2 right = extra_h - left top = extra_v // 2 bottom = extra_v - top
x = F.pad(x, [left, right, top, bottom])
x = self.pool(x) return x123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609from collections import OrderedDictfrom nets.layers import (Conv2dStaticSamePadding, MaxPool2dStaticSamePadding, MemoryEfficientSwish, Swish)import torchimport torch.nn as nn
from nets.CSPdarknet import darknet53
def conv2d(filter_in, filter_out, kernel_size, stride=1): pad = (kernel_size - 1) // 2 if kernel_size else 0 return nn.Sequential(OrderedDict([ ("conv", nn.Conv2d(filter_in, filter_out, kernel_size=kernel_size, stride=stride, padding=pad, bias=False)), ("bn", nn.BatchNorm2d(filter_out)), ("relu", nn.LeakyReLU(0.1)), ]))
#---------------------------------------------------## SPP结构,利用不同大小的池化核进行池化# 池化后堆叠#---------------------------------------------------#class SpatialPyramidPooling(nn.Module): def __init__(self, pool_sizes=[5, 9, 13]): super(SpatialPyramidPooling, self).__init__()
self.maxpools = nn.ModuleList([nn.MaxPool2d(pool_size, 1, pool_size//2) for pool_size in pool_sizes])
def forward(self, x): features = [maxpool(x) for maxpool in self.maxpools[::-1]] features = torch.cat(features + [x], dim=1)#5,9,13和短接边
return features
#---------------------------------------------------## 卷积 + 上采样#---------------------------------------------------#class Upsample(nn.Module): def __init__(self, in_channels, out_channels): super(Upsample, self).__init__()
self.upsample = nn.Sequential( conv2d(in_channels, out_channels, 1), nn.Upsample(scale_factor=2, mode='nearest') )
def forward(self, x,): x = self.upsample(x) return x
#---------------------------------------------------## 三次卷积块#---------------------------------------------------#def make_three_conv(filters_list, in_filters): m = nn.Sequential( conv2d(in_filters, filters_list[0], 1), conv2d(filters_list[0], filters_list[1], 3), conv2d(filters_list[1], filters_list[0], 1), ) return m
#---------------------------------------------------## 五次卷积块#---------------------------------------------------#def make_five_conv(filters_list, in_filters): m = nn.Sequential( conv2d(in_filters, filters_list[0], 1), conv2d(filters_list[0], filters_list[1], 3), conv2d(filters_list[1], filters_list[0], 1), conv2d(filters_list[0], filters_list[1], 3), conv2d(filters_list[1], filters_list[0], 1), ) return m
#---------------------------------------------------## 最后获得yolov4的输出#---------------------------------------------------#def yolo_head(filters_list, in_filters): m = nn.Sequential( conv2d(in_filters, filters_list[0], 3), nn.Conv2d(filters_list[0], filters_list[1], 1), ) #W: 此处的conv2d是卷积+标准化+激活函数,而nn.Conv2d只是一个1*1的卷积而已 return m
class SeparableConvBlock(nn.Module): def __init__(self, in_channels, out_channels=None, norm=True, activation=False, onnx_export=False): super(SeparableConvBlock, self).__init__() if out_channels is None: out_channels = in_channels
self.depthwise_conv = Conv2dStaticSamePadding(in_channels, in_channels, kernel_size=3, stride=1, groups=in_channels, bias=False) self.pointwise_conv = Conv2dStaticSamePadding(in_channels, out_channels, kernel_size=1, stride=1)
self.norm = norm if self.norm: self.bn = nn.BatchNorm2d(num_features=out_channels, momentum=0.01, eps=1e-3)
self.activation = activation if self.activation: self.swish = MemoryEfficientSwish() if not onnx_export else Swish()
def forward(self, x): x = self.depthwise_conv(x) x = self.pointwise_conv(x)
if self.norm: x = self.bn(x)
if self.activation: x = self.swish(x)
return x
#---------------------------------------------------## yolo_body#---------------------------------------------------## class YoloBody(nn.Module):# def __init__(self, num_anchors, num_classes):# super(YoloBody, self).__init__()# #---------------------------------------------------## # 生成CSPdarknet53的主干模型# # 获得三个有效特征层,他们的shape分别是:# # 52,52,256# # 26,26,512# # 13,13,1024# #---------------------------------------------------## self.backbone = darknet53(None)## self.conv1 = make_three_conv([512,1024],1024)# self.SPP = SpatialPyramidPooling()# self.conv2 = make_three_conv([512,1024],2048)## self.upsample1 = Upsample(512,256)# self.conv_for_P4 = conv2d(512,256,1)# self.make_five_conv1 = make_five_conv([256, 512],512)## self.upsample2 = Upsample(256,128)# self.conv_for_P3 = conv2d(256,128,1)# self.make_five_conv2 = make_five_conv([128, 256],256)## # 3*(5+num_classes) = 3*(5+20) = 3*(4+1+20)=75# # W: head3对应52*52*256特征层# final_out_filter2 = num_anchors * (5 + num_classes)# self.yolo_head3 = yolo_head([256, final_out_filter2],128)## self.down_sample1 = conv2d(128,256,3,stride=2)# self.make_five_conv3 = make_five_conv([256, 512],512)## # 3*(5+num_classes) = 3*(5+20) = 3*(4+1+20)=75,其中的1是用来判断先验框内部是否包含物体# # w:head2对应26*26有效特征层# final_out_filter1 = num_anchors * (5 + num_classes)# self.yolo_head2 = yolo_head([512, final_out_filter1],256)## self.down_sample2 = conv2d(256,512,3,stride=2)# self.make_five_conv4 = make_five_conv([512, 1024],1024)## # 3*(5+num_classes)=3*(5+20)=3*(4+1+20)=75# # head1对应13*13*1024特征层# final_out_filter0 = num_anchors * (5 + num_classes)# self.yolo_head1 = yolo_head([1024, final_out_filter0],512)# #w:下面为我写的# final_out_filter3 = num_anchors * (5 + num_classes)# self.yolo_head4 = yolo_head([128, final_out_filter3], 64)# self.conv_for_P2 = conv2d(128, 64, 1)## final_out_filter4 = num_anchors * (5 + num_classes)# self.yolo_head5 = yolo_head([64, final_out_filter4], 32)# self.conv_for_P1 = conv2d(64, 32, 1)# #w:上面是我写的#### def forward(self, x):# # backbone# x4, x3, x2, x1, x0 = self.backbone(x)## #w:下面是我写的# P2 = self.conv_for_P2(x3)# P1 = self.conv_for_P1(x4)# #w:上面是我写的## # 13,13,1024 -> 13,13,512 -> 13,13,1024 -> 13,13,512 -> 13,13,2048# P5 = self.conv1(x0)# P5 = self.SPP(P5)# # 13,13,2048 -> 13,13,512 -> 13,13,1024 -> 13,13,512# P5 = self.conv2(P5)## # 13,13,512 -> 13,13,256 -> 26,26,256# P5_upsample = self.upsample1(P5)# # 26,26,512 -> 26,26,256# P4 = self.conv_for_P4(x1)# # 26,26,256 + 26,26,256 -> 26,26,512# P4 = torch.cat([P4,P5_upsample],axis=1)# # 26,26,512 -> 26,26,256 -> 26,26,512 -> 26,26,256 -> 26,26,512 -> 26,26,256# P4 = self.make_five_conv1(P4)## # 26,26,256 -> 26,26,128 -> 52,52,128# P4_upsample = self.upsample2(P4)# # 52,52,256 -> 52,52,128# P3 = self.conv_for_P3(x2)# # 52,52,128 + 52,52,128 -> 52,52,256# P3 = torch.cat([P3,P4_upsample],axis=1)# # 52,52,256 -> 52,52,128 -> 52,52,256 -> 52,52,128 -> 52,52,256 -> 52,52,128# P3 = self.make_five_conv2(P3)## # 52,52,128 -> 26,26,256# P3_downsample = self.down_sample1(P3)# # 26,26,256 + 26,26,256 -> 26,26,512# P4 = torch.cat([P3_downsample,P4],axis=1)# # 26,26,512 -> 26,26,256 -> 26,26,512 -> 26,26,256 -> 26,26,512 -> 26,26,256# P4 = self.make_five_conv3(P4)## # 26,26,256 -> 13,13,512# P4_downsample = self.down_sample2(P4)# # 13,13,512 + 13,13,512 -> 13,13,1024# P5 = torch.cat([P4_downsample,P5],axis=1)# # 13,13,1024 -> 13,13,512 -> 13,13,1024 -> 13,13,512 -> 13,13,1024 -> 13,13,512# P5 = self.make_five_conv4(P5)## #---------------------------------------------------## # 第三个特征层# # y3=(batch_size,75,52,52)# #---------------------------------------------------## out2 = self.yolo_head3(P3)# #---------------------------------------------------## # 第二个特征层# # y2=(batch_size,75,26,26)# #---------------------------------------------------## out1 = self.yolo_head2(P4)# #---------------------------------------------------## # 第一个特征层# # y1=(batch_size,75,13,13)# #---------------------------------------------------## out0 = self.yolo_head1(P5)## #w:下面是我写的# out3 = self.yolo_head4(P2)# out4 = self.yolo_head5(P1)# #w: 上面是我写的## return out0, out1, out2, out3, out4### ################################################################################################
class YoloBody(nn.Module): def __init__(self, num_anchors, num_classes): super(YoloBody, self).__init__() #---------------------------------------------------# # 生成CSPdarknet53的主干模型 # 获得三个有效特征层,他们的shape分别是: # 52,52,256 # 26,26,512 # 13,13,1024 #---------------------------------------------------# self.backbone = darknet53(None)
self.conv1 = make_three_conv([512,1024],1024) self.SPP = SpatialPyramidPooling() self.conv2 = make_three_conv([512,1024],2048)
self.upsample1 = Upsample(512,256) self.conv_for_P4 = conv2d(512,256,1) self.make_five_conv1 = make_five_conv([256, 512],512)
self.upsample2 = Upsample(256,128) self.conv_for_P3 = conv2d(256,128,1) self.make_five_conv2 = make_five_conv([128, 256],256)
# 3*(5+num_classes) = 3*(5+20) = 3*(4+1+20)=75 # W: head3对应52*52*256特征层 final_out_filter2 = num_anchors * (5 + num_classes) self.yolo_head3 = yolo_head([512, final_out_filter2],256)
self.down_sample1 = conv2d(128,256,3,stride=2) self.make_five_conv3 = make_five_conv([256, 512],512)
# 3*(5+num_classes) = 3*(5+20) = 3*(4+1+20)=75,其中的1是用来判断先验框内部是否包含物体 # w:head2对应26*26有效特征层 final_out_filter1 = num_anchors * (5 + num_classes) self.yolo_head2 = yolo_head([1024, final_out_filter1],512)
self.down_sample2 = conv2d(256,512,3,stride=2) self.make_five_conv4 = make_five_conv([512, 1024],1024)
# 3*(5+num_classes)=3*(5+20)=3*(4+1+20)=75 # head1对应13*13*1024特征层 final_out_filter0 = num_anchors * (5 + num_classes) self.yolo_head1 = yolo_head([2048, final_out_filter0],1024) #w:下面为我写的 final_out_filter3 = num_anchors * (5 + num_classes) self.yolo_head4 = yolo_head([256, final_out_filter3], 128) self.conv_for_P2 = conv2d(128, 64, 1)
final_out_filter4 = num_anchors * (5 + num_classes) self.yolo_head5 = yolo_head([128, final_out_filter4], 64) self.conv_for_P1 = conv2d(64, 32, 1) #w:上面是我写的 ################################################################################################################ self.p5_down_channel = nn.Sequential( Conv2dStaticSamePadding(512, 64, 1), nn.BatchNorm2d(64, momentum=0.01, eps=1e-3), ) self.p4_down_channel = nn.Sequential( Conv2dStaticSamePadding(256, 64, 1), nn.BatchNorm2d(64, momentum=0.01, eps=1e-3), ) self.p3_down_channel = nn.Sequential( Conv2dStaticSamePadding(128, 64, 1), nn.BatchNorm2d(64, momentum=0.01, eps=1e-3), ) self.p4_down_channel_2 = nn.Sequential( Conv2dStaticSamePadding(256, 64, 1), nn.BatchNorm2d(64, momentum=0.01, eps=1e-3), ) self.p3_down_channel_2 = nn.Sequential( Conv2dStaticSamePadding(128, 64, 1), nn.BatchNorm2d(64, momentum=0.01, eps=1e-3), ) # 简易注意力机制的weights self.p6_w1 = nn.Parameter(torch.ones(2, dtype=torch.float32), requires_grad=True) self.p6_w1_relu = nn.ReLU() self.p5_w1 = nn.Parameter(torch.ones(2, dtype=torch.float32), requires_grad=True) self.p5_w1_relu = nn.ReLU() self.p4_w1 = nn.Parameter(torch.ones(2, dtype=torch.float32), requires_grad=True) self.p4_w1_relu = nn.ReLU() self.p3_w1 = nn.Parameter(torch.ones(2, dtype=torch.float32), requires_grad=True) self.p3_w1_relu = nn.ReLU()
self.p4_w2 = nn.Parameter(torch.ones(3, dtype=torch.float32), requires_grad=True) self.p4_w2_relu = nn.ReLU() self.p5_w2 = nn.Parameter(torch.ones(3, dtype=torch.float32), requires_grad=True) self.p5_w2_relu = nn.ReLU() self.p6_w2 = nn.Parameter(torch.ones(3, dtype=torch.float32), requires_grad=True) self.p6_w2_relu = nn.ReLU() self.p7_w2 = nn.Parameter(torch.ones(2, dtype=torch.float32), requires_grad=True) self.p7_w2_relu = nn.ReLU()
self.attention = True self.epsilon = 1e-4 self.swish = MemoryEfficientSwish() if not False else Swish()
self.p6_upsample = nn.Upsample(scale_factor=2, mode='nearest') self.p5_upsample = nn.Upsample(scale_factor=2, mode='nearest') self.p4_upsample = nn.Upsample(scale_factor=2, mode='nearest') self.p3_upsample = nn.Upsample(scale_factor=2, mode='nearest')
self.conv6_up = SeparableConvBlock(64, onnx_export=False) self.conv5_up = SeparableConvBlock(64, onnx_export=False) self.conv4_up = SeparableConvBlock(64, onnx_export=False) self.conv3_up = SeparableConvBlock(64, onnx_export=False)
self.conv4_down = SeparableConvBlock(64, onnx_export=False) self.conv5_down = SeparableConvBlock(64, onnx_export=False) self.conv6_down = SeparableConvBlock(64, onnx_export=False) self.conv7_down = SeparableConvBlock(64, onnx_export=False)
self.p4_downsample = MaxPool2dStaticSamePadding(3, 2) self.p5_downsample = MaxPool2dStaticSamePadding(3, 2) self.p6_downsample = MaxPool2dStaticSamePadding(3, 2) self.p7_downsample = MaxPool2dStaticSamePadding(3, 2)
self.p3_final_channel = nn.Sequential( Conv2dStaticSamePadding(64, 64, 1), nn.BatchNorm2d(64, momentum=0.01, eps=1e-3), ) self.p4_final_channel = nn.Sequential( Conv2dStaticSamePadding(64, 128, 1), nn.BatchNorm2d(128, momentum=0.01, eps=1e-3), ) self.p5_final_channel = nn.Sequential( Conv2dStaticSamePadding(64, 256, 1), nn.BatchNorm2d(256, momentum=0.01, eps=1e-3), ) self.p6_final_channel = nn.Sequential( Conv2dStaticSamePadding(64, 512, 1), nn.BatchNorm2d(512, momentum=0.01, eps=1e-3), ) self.p7_final_channel = nn.Sequential( Conv2dStaticSamePadding(64, 1024, 1), nn.BatchNorm2d(1024, momentum=0.01, eps=1e-3), )
self.conv_for_P = conv2d(64, 64, 1)
self.p5_to_final = nn.Sequential( Conv2dStaticSamePadding(1024, 2048, 1), nn.BatchNorm2d(2048, momentum=0.01, eps=1e-3), MaxPool2dStaticSamePadding(3, 2) ) self.conv1final = make_three_conv([1024, 2048], 2048) self.SPPFinal = SpatialPyramidPooling() self.conv2final = make_three_conv([1024, 2048], 4096)
self.pFinal_down_channel = nn.Sequential( Conv2dStaticSamePadding(1024, 64, 1), nn.BatchNorm2d(64, momentum=0.01, eps=1e-3), )
################################################################################################################# def forward(self, x): # backbone x4, x3, x2, x1, x0, x100 = self.backbone(x)
#w:下面是我写的 P2 = self.conv_for_P2(x3) #P1 = self.conv_for_P1(x4) # #w:上面是我写的 #6,6,2048 #Pfinal = self.p5_to_final(x0) #6,6,2048 -> 6,6,1024 -> 6,6,2048 -> 6,6,1024 ->6,6,4096 Pfinal = self.conv1final(x100) Pfinal = self.SPPFinal(Pfinal) #6,6,4096 -> 6,6,1024 -> 6,6,2048 -> 6,6,1024 Pfinal = self.conv2final(Pfinal) # # 13,13,1024 -> 13,13,512 -> 13,13,1024 -> 13,13,512 -> 13,13,2048 P5 = self.conv1(x0) P5 = self.SPP(P5) # # 13,13,2048 -> 13,13,512 -> 13,13,1024 -> 13,13,512 P5 = self.conv2(P5) # # # 13,13,512 -> 13,13,256 -> 26,26,256 # P5_upsample = self.upsample1(P5) # # 26,26,512 -> 26,26,256 P4 = self.conv_for_P4(x1) # # 26,26,256 + 26,26,256 -> 26,26,512 # P4 = torch.cat([P4,P5_upsample],axis=1) # # 26,26,512 -> 26,26,256 -> 26,26,512 -> 26,26,256 -> 26,26,512 -> 26,26,256 # P4 = self.make_five_conv1(P4) # # # 26,26,256 -> 26,26,128 -> 52,52,128 # P4_upsample = self.upsample2(P4) # # 52,52,256 -> 52,52,128 P3 = self.conv_for_P3(x2) # # 52,52,128 + 52,52,128 -> 52,52,256 # P3 = torch.cat([P3,P4_upsample],axis=1) # # 52,52,256 -> 52,52,128 -> 52,52,256 -> 52,52,128 -> 52,52,256 -> 52,52,128 # P3 = self.make_five_conv2(P3) # # # 52,52,128 -> 26,26,256 # P3_downsample = self.down_sample1(P3) # # 26,26,256 + 26,26,256 -> 26,26,512 # P4 = torch.cat([P3_downsample,P4],axis=1) # # 26,26,512 -> 26,26,256 -> 26,26,512 -> 26,26,256 -> 26,26,512 -> 26,26,256 # P4 = self.make_five_conv3(P4) # # # 26,26,256 -> 13,13,512 # P4_downsample = self.down_sample2(P4) # # 13,13,512 + 13,13,512 -> 13,13,1024 # P5 = torch.cat([P4_downsample,P5],axis=1) # # 13,13,1024 -> 13,13,512 -> 13,13,1024 -> 13,13,512 -> 13,13,1024 -> 13,13,512 # P5 = self.make_five_conv4(P5) # # #---------------------------------------------------# # # 第三个特征层 # # y3=(batch_size,75,52,52) # #---------------------------------------------------# # out2 = self.yolo_head3(P3) # #---------------------------------------------------# # # 第二个特征层 # # y2=(batch_size,75,26,26) # #---------------------------------------------------# # out1 = self.yolo_head2(P4) # #---------------------------------------------------# # # 第一个特征层 # # y1=(batch_size,75,13,13) # #---------------------------------------------------# # out0 = self.yolo_head1(P5) # # #w:下面是我写的 # out3 = self.yolo_head4(P2) # out4 = self.yolo_head5(P1) # #w: 上面是我写的 ################################################################################################ #设置即将进入第一次bifpn的入口
pre2_in = P2 pre3_in1 = self.p3_down_channel(P3) pre3_in_2 = self.p3_down_channel_2(P3) pre4_in1 = self.p4_down_channel(P4) pre4_in_2 = self.p4_down_channel_2(P4) pre5_in = self.p5_down_channel(P5) pre1_in = self.pFinal_down_channel(Pfinal) ##################################################################################################
################################################################################################## # 将此处的入口,转化为efficientdet的bifpn入口参数 p3_in = pre2_in p4_in_1 = pre3_in1 p4_in_2 = pre3_in_2 p5_in_1 = pre4_in1 p5_in_2 = pre4_in_2 p6_in = pre5_in p7_in = pre1_in ############################################################################################################
############################################################################################################ #第一次进行bifpn # 简单的注意力机制,用于确定更关注p7_in还是p6_in p6_w1 = self.p6_w1_relu(self.p6_w1) weight = p6_w1 / (torch.sum(p6_w1, dim=0) + self.epsilon) p6_td = self.conv6_up(self.swish(weight[0] * p6_in + weight[1] * self.p6_upsample(p7_in)))
# 简单的注意力机制,用于确定更关注p6_up还是p5_in p5_w1 = self.p5_w1_relu(self.p5_w1) weight = p5_w1 / (torch.sum(p5_w1, dim=0) + self.epsilon) p5_td = self.conv5_up(self.swish(weight[0] * p5_in_1 + weight[1] * self.p5_upsample(p6_td)))
# 简单的注意力机制,用于确定更关注p5_up还是p4_in p4_w1 = self.p4_w1_relu(self.p4_w1) weight = p4_w1 / (torch.sum(p4_w1, dim=0) + self.epsilon) p4_td = self.conv4_up(self.swish(weight[0] * p4_in_1 + weight[1] * self.p4_upsample(p5_td)))
# 简单的注意力机制,用于确定更关注p4_up还是p3_in p3_w1 = self.p3_w1_relu(self.p3_w1) weight = p3_w1 / (torch.sum(p3_w1, dim=0) + self.epsilon) p3_out = self.conv3_up(self.swish(weight[0] * p3_in + weight[1] * self.p3_upsample(p4_td)))
# 简单的注意力机制,用于确定更关注p4_in_2还是p4_up还是p3_out p4_w2 = self.p4_w2_relu(self.p4_w2) weight = p4_w2 / (torch.sum(p4_w2, dim=0) + self.epsilon) p4_out = self.conv4_down( self.swish(weight[0] * p4_in_2 + weight[1] * p4_td + weight[2] * self.p4_downsample(p3_out)))
# 简单的注意力机制,用于确定更关注p5_in_2还是p5_up还是p4_out p5_w2 = self.p5_w2_relu(self.p5_w2) weight = p5_w2 / (torch.sum(p5_w2, dim=0) + self.epsilon) p5_out = self.conv5_down( self.swish(weight[0] * p5_in_2 + weight[1] * p5_td + weight[2] * self.p5_downsample(p4_out)))
# 简单的注意力机制,用于确定更关注p6_in还是p6_up还是p5_out p6_w2 = self.p6_w2_relu(self.p6_w2) weight = p6_w2 / (torch.sum(p6_w2, dim=0) + self.epsilon) p6_out = self.conv6_down( self.swish(weight[0] * p6_in + weight[1] * p6_td + weight[2] * self.p6_downsample(p5_out)))
# 简单的注意力机制,用于确定更关注p7_in还是p7_up还是p6_out p7_w2 = self.p7_w2_relu(self.p7_w2) weight = p7_w2 / (torch.sum(p7_w2, dim=0) + self.epsilon) p7_out = self.conv7_down(self.swish(weight[0] * p7_in + weight[1] * self.p7_downsample(p6_out))) ########################################################################################################### #第二次bifpn # p13_in = self.conv_for_P(p3_out) # p14_in = self.conv_for_P(p4_out) # p15_in = self.conv_for_P(p5_out) # p16_in = self.conv_for_P(p6_out) # p17_in = self.conv_for_P(p7_out) # # p16_td = self.conv6_up(self.swish(p16_in + self.p6_upsample(p17_in))) # # p15_td = self.conv5_up(self.swish(p15_in + self.p5_upsample(p16_td))) # # p14_td = self.conv4_up(self.swish(p14_in + self.p4_upsample(p15_td))) # # p13_out = self.conv3_up(self.swish(p13_in + self.p3_upsample(p14_td))) # # p14_out = self.conv4_down( # self.swish(p14_in + p14_td + self.p4_downsample(p13_out))) # # p15_out = self.conv5_down( # self.swish(p15_in + p15_td + self.p5_downsample(p14_out))) # # p16_out = self.conv6_down( # self.swish(p16_in + p16_td + self.p6_downsample(p15_out))) # # p17_out = self.conv7_down(self.swish(p17_in + self.p7_downsample(p16_out))) # ############################################################################################################ # # ############################################################################################################ # #第三次bifpn # # p23_in = self.conv_for_P(p13_out) # # p24_in = self.conv_for_P(p14_out) # # p25_in = self.conv_for_P(p15_out) # # p26_in = self.conv_for_P(p16_out) # # p27_in = self.conv_for_P(p17_out) # # # # p26_td = self.conv6_up(self.swish(p26_in + self.p6_upsample(p27_in))) # # # # p25_td = self.conv5_up(self.swish(p25_in + self.p5_upsample(p26_td))) # # # # p24_td = self.conv4_up(self.swish(p24_in + self.p4_upsample(p25_td))) # # # # p23_out = self.conv3_up(self.swish(p23_in + self.p3_upsample(p24_td))) # # # # p24_out = self.conv4_down( # # self.swish(p24_in + p24_td + self.p4_downsample(p23_out))) # # # # p25_out = self.conv5_down( # # self.swish(p25_in + p25_td + self.p5_downsample(p24_out))) # # # # p26_out = self.conv6_down( # # self.swish(p26_in + p26_td + self.p6_downsample(p25_out))) # # # # p27_out = self.conv7_down(self.swish(p27_in + self.p7_downsample(p26_out))) # ########################################################################################################### # # # # #调整输出,仅一次bifpn时 out0 = self.yolo_head1(self.p7_final_channel(p7_out)) out1 = self.yolo_head2(self.p6_final_channel(p6_out)) out2 = self.yolo_head3(self.p5_final_channel(p5_out)) out3 = self.yolo_head4(self.p4_final_channel(p4_out)) out4 = self.yolo_head5(self.p3_final_channel(p3_out))
############################################################################################################ return out0, out1, out2, out3, out4123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690from typing import List
import cv2from random import shuffleimport numpy as npimport torchimport torch.nn as nnimport mathimport torch.nn.functional as Ffrom matplotlib.colors import rgb_to_hsv, hsv_to_rgbfrom PIL import Imagefrom utils.utils import bbox_iou, merge_bboxes
def jaccard(_box_a, _box_b): b1_x1, b1_x2 = _box_a[:, 0] - _box_a[:, 2] / 2, _box_a[:, 0] + _box_a[:, 2] / 2 b1_y1, b1_y2 = _box_a[:, 1] - _box_a[:, 3] / 2, _box_a[:, 1] + _box_a[:, 3] / 2 b2_x1, b2_x2 = _box_b[:, 0] - _box_b[:, 2] / 2, _box_b[:, 0] + _box_b[:, 2] / 2 b2_y1, b2_y2 = _box_b[:, 1] - _box_b[:, 3] / 2, _box_b[:, 1] + _box_b[:, 3] / 2 box_a = torch.zeros_like(_box_a) box_b = torch.zeros_like(_box_b) box_a[:, 0], box_a[:, 1], box_a[:, 2], box_a[:, 3] = b1_x1, b1_y1, b1_x2, b1_y2 box_b[:, 0], box_b[:, 1], box_b[:, 2], box_b[:, 3] = b2_x1, b2_y1, b2_x2, b2_y2 A = box_a.size(0) B = box_b.size(0) max_xy = torch.min(box_a[:, 2:].unsqueeze(1).expand(A, B, 2), box_b[:, 2:].unsqueeze(0).expand(A, B, 2)) min_xy = torch.max(box_a[:, :2].unsqueeze(1).expand(A, B, 2), box_b[:, :2].unsqueeze(0).expand(A, B, 2)) inter = torch.clamp((max_xy - min_xy), min=0)
inter = inter[:, :, 0] * inter[:, :, 1] # 计算先验框和真实框各自的面积 area_a = ((box_a[:, 2]-box_a[:, 0]) * (box_a[:, 3]-box_a[:, 1])).unsqueeze(1).expand_as(inter) # [A,B] area_b = ((box_b[:, 2]-box_b[:, 0]) * (box_b[:, 3]-box_b[:, 1])).unsqueeze(0).expand_as(inter) # [A,B] # 求IOU union = area_a + area_b - inter return inter / union # [A,B] #---------------------------------------------------## 平滑标签#---------------------------------------------------#def smooth_labels(y_true, label_smoothing,num_classes): return y_true * (1.0 - label_smoothing) + label_smoothing / num_classes
def box_ciou(b1, b2): """ 输入为: ---------- b1: tensor, shape=(batch, feat_w, feat_h, anchor_num, 4), xywh b2: tensor, shape=(batch, feat_w, feat_h, anchor_num, 4), xywh
返回为: ------- ciou: tensor, shape=(batch, feat_w, feat_h, anchor_num, 1) """ # 求出预测框左上角右下角 b1_xy = b1[..., :2] b1_wh = b1[..., 2:4] b1_wh_half = b1_wh/2. b1_mins = b1_xy - b1_wh_half b1_maxes = b1_xy + b1_wh_half # 求出真实框左上角右下角 b2_xy = b2[..., :2] b2_wh = b2[..., 2:4] b2_wh_half = b2_wh/2. b2_mins = b2_xy - b2_wh_half b2_maxes = b2_xy + b2_wh_half
# 求真实框和预测框所有的iou intersect_mins = torch.max(b1_mins, b2_mins) intersect_maxes = torch.min(b1_maxes, b2_maxes) intersect_wh = torch.max(intersect_maxes - intersect_mins, torch.zeros_like(intersect_maxes)) intersect_area = intersect_wh[..., 0] * intersect_wh[..., 1] b1_area = b1_wh[..., 0] * b1_wh[..., 1] b2_area = b2_wh[..., 0] * b2_wh[..., 1] union_area = b1_area + b2_area - intersect_area iou = intersect_area / torch.clamp(union_area,min = 1e-6)
# 计算中心的差距 center_distance = torch.sum(torch.pow((b1_xy - b2_xy), 2), axis=-1) # 找到包裹两个框的最小框的左上角和右下角 enclose_mins = torch.min(b1_mins, b2_mins) enclose_maxes = torch.max(b1_maxes, b2_maxes) enclose_wh = torch.max(enclose_maxes - enclose_mins, torch.zeros_like(intersect_maxes)) # 计算对角线距离 enclose_diagonal = torch.sum(torch.pow(enclose_wh,2), axis=-1) ciou = iou - 1.0 * (center_distance) / torch.clamp(enclose_diagonal,min = 1e-6) v = (4 / (math.pi ** 2)) * torch.pow((torch.atan(b1_wh[..., 0]/torch.clamp(b1_wh[..., 1],min = 1e-6)) - torch.atan(b2_wh[..., 0]/torch.clamp(b2_wh[..., 1],min = 1e-6))), 2) alpha = v / torch.clamp((1.0 - iou + v),min=1e-6) ciou = ciou - alpha * v return ciou def clip_by_tensor(t,t_min,t_max): t=t.float() result = (t >= t_min).float() * t + (t < t_min).float() * t_min result = (result <= t_max).float() * result + (result > t_max).float() * t_max return result
def MSELoss(pred,target): return (pred-target)**2
def BCELoss(pred,target): epsilon = 1e-7 pred = clip_by_tensor(pred, epsilon, 1.0 - epsilon) output = -target * torch.log(pred) - (1.0 - target) * torch.log(1.0 - pred) return output
class YOLOLoss(nn.Module): def __init__(self, anchors, num_classes, img_size, label_smooth=0, cuda=True, normalize=True): super(YOLOLoss, self).__init__() self.anchors = anchors self.num_anchors = len(anchors) self.num_classes = num_classes self.bbox_attrs = 5 + num_classes self.img_size = img_size #self.feature_length = [img_size[0]//32,img_size[0]//16,img_size[0]//8] self.feature_length = [img_size[0] // 64, img_size[0] // 32, img_size[0] // 16, img_size[0] // 8, img_size[0] // 4] self.label_smooth = label_smooth
self.ignore_threshold = 0.5 self.lambda_conf = 1.0 self.lambda_cls = 1.0 self.lambda_loc = 1.0 self.cuda = cuda self.normalize = normalize
def forward(self, input, targets=None): #----------------------------------------------------# # input的shape为 bs, 3*(5+num_classes), 13, 13 # bs, 3*(5+num_classes), 26, 26 # bs, 3*(5+num_classes), 52, 52 #----------------------------------------------------# #-----------------------# # 一共多少张图片 #-----------------------# bs = input.size(0) #-----------------------# # 特征层的高 13 #-----------------------# in_h = input.size(2) #-----------------------# # 特征层的宽 13 #-----------------------# in_w = input.size(3)
#-----------------------------------------------------------------------# # 计算步长 # 每一个特征点对应原来的图片上多少个像素点 # 如果特征层为13x13的话,一个特征点就对应原来的图片上的32个像素点 # 如果特征层为26x26的话,一个特征点就对应原来的图片上的16个像素点 # 如果特征层为52x52的话,一个特征点就对应原来的图片上的8个像素点 # stride_h = stride_w = 32、16、8 #-----------------------------------------------------------------------# stride_h = self.img_size[1] / in_h stride_w = self.img_size[0] / in_w
#-------------------------------------------------# # 此时获得的scaled_anchors大小是相对于特征层的 #-------------------------------------------------# scaled_anchors = [(a_w / stride_w, a_h / stride_h) for a_w, a_h in self.anchors] #-----------------------------------------------# # 输入的input一共有三个,他们的shape分别是 # batch_size, 3, 13, 13, 5 + num_classes # batch_size, 3, 26, 26, 5 + num_classes # batch_size, 3, 52, 52, 5 + num_classes #-----------------------------------------------# prediction = input.view(bs, int(self.num_anchors/5), self.bbox_attrs, in_h, in_w).permute(0, 1, 3, 4, 2).contiguous() # 获得置信度,是否有物体 conf = torch.sigmoid(prediction[..., 4]) # 种类置信度 pred_cls = torch.sigmoid(prediction[..., 5:])
#---------------------------------------------------------------# # 找到哪些先验框内部包含物体 # 利用真实框和先验框计算交并比 # mask batch_size, 3, in_h, in_w 有目标的特征点 # noobj_mask batch_size, 3, in_h, in_w 无目标的特征点 # t_box batch_size, 3, in_h, in_w, 4 中心宽高的真实值 # tconf batch_size, 3, in_h, in_w 置信度真实值 # tcls batch_size, 3, in_h, in_w, num_classes 种类真实值 #----------------------------------------------------------------# mask, noobj_mask, t_box, tconf, tcls, box_loss_scale_x, box_loss_scale_y = self.get_target(targets, scaled_anchors,in_w, in_h,self.ignore_threshold)
#---------------------------------------------------------------# # 将预测结果进行解码,判断预测结果和真实值的重合程度 # 如果重合程度过大则忽略,因为这些特征点属于预测比较准确的特征点 # 作为负样本不合适 #----------------------------------------------------------------# noobj_mask, pred_boxes_for_ciou = self.get_ignore(prediction, targets, scaled_anchors, in_w, in_h, noobj_mask)
if self.cuda: mask, noobj_mask = mask.cuda(), noobj_mask.cuda() box_loss_scale_x, box_loss_scale_y= box_loss_scale_x.cuda(), box_loss_scale_y.cuda() tconf, tcls = tconf.cuda(), tcls.cuda() pred_boxes_for_ciou = pred_boxes_for_ciou.cuda() t_box = t_box.cuda()
box_loss_scale = 2 - box_loss_scale_x * box_loss_scale_y #---------------------------------------------------------------# # 计算预测结果和真实结果的CIOU #----------------------------------------------------------------# ciou = (1 - box_ciou( pred_boxes_for_ciou[mask.bool()], t_box[mask.bool()]))* box_loss_scale[mask.bool()] loss_loc = torch.sum(ciou)
# 计算置信度的loss loss_conf = torch.sum(BCELoss(conf, mask) * mask) + \ torch.sum(BCELoss(conf, mask) * noobj_mask) loss_cls = torch.sum(BCELoss(pred_cls[mask == 1], smooth_labels(tcls[mask == 1],self.label_smooth,self.num_classes))) loss = loss_conf * self.lambda_conf + loss_cls * self.lambda_cls + loss_loc * self.lambda_loc
if self.normalize: num_pos = torch.sum(mask) num_pos = torch.max(num_pos, torch.ones_like(num_pos)) else: num_pos = bs/5
return loss, num_pos
def get_target(self, target, anchors, in_w, in_h, ignore_threshold): #-----------------------------------------------------# # 计算一共有多少张图片 #-----------------------------------------------------# bs = len(target) #-------------------------------------------------------# # 获得当前特征层先验框所属的编号,方便后面对先验框筛选 #-------------------------------------------------------# anchor_index: List[int] = [[0,1,2],[3,4,5],[6,7,8],[9,10,11],[12,13,14]][self.feature_length.index(in_w)] subtract_index = [0,3,6,9,12][self.feature_length.index(in_w)] #-------------------------------------------------------# # 创建全是0或者全是1的阵列 #-------------------------------------------------------# mask = torch.zeros(bs, int(self.num_anchors/5), in_h, in_w, requires_grad=False) noobj_mask = torch.ones(bs, int(self.num_anchors/5), in_h, in_w, requires_grad=False)
tx = torch.zeros(bs, int(self.num_anchors/5), in_h, in_w, requires_grad=False) ty = torch.zeros(bs, int(self.num_anchors/5), in_h, in_w, requires_grad=False) tw = torch.zeros(bs, int(self.num_anchors/5), in_h, in_w, requires_grad=False) th = torch.zeros(bs, int(self.num_anchors/5), in_h, in_w, requires_grad=False) t_box = torch.zeros(bs, int(self.num_anchors/5), in_h, in_w, 4, requires_grad=False) tconf = torch.zeros(bs, int(self.num_anchors/5), in_h, in_w, requires_grad=False) tcls = torch.zeros(bs, int(self.num_anchors/5), in_h, in_w, self.num_classes, requires_grad=False)
box_loss_scale_x = torch.zeros(bs, int(self.num_anchors/5), in_h, in_w, requires_grad=False) box_loss_scale_y = torch.zeros(bs, int(self.num_anchors/5), in_h, in_w, requires_grad=False) for b in range(bs): if len(target[b])==0: continue #-------------------------------------------------------# # 计算出正样本在特征层上的中心点 #-------------------------------------------------------# gxs = target[b][:, 0:1] * in_w gys = target[b][:, 1:2] * in_h #-------------------------------------------------------# # 计算出正样本相对于特征层的宽高 #-------------------------------------------------------# gws = target[b][:, 2:3] * in_w ghs = target[b][:, 3:4] * in_h
#-------------------------------------------------------# # 计算出正样本属于特征层的哪个特征点 #-------------------------------------------------------# gis = torch.floor(gxs) gjs = torch.floor(gys) #-------------------------------------------------------# # 将真实框转换一个形式 # num_true_box, 4 #-------------------------------------------------------# gt_box = torch.FloatTensor(torch.cat([torch.zeros_like(gws), torch.zeros_like(ghs), gws, ghs], 1)) #-------------------------------------------------------# # 将先验框转换一个形式 # 9, 4 #-------------------------------------------------------# anchor_shapes = torch.FloatTensor(torch.cat((torch.zeros((self.num_anchors, 2)), torch.FloatTensor(anchors)), 1)) #-------------------------------------------------------# # 计算交并比 # num_true_box, 9 #-------------------------------------------------------# anch_ious = jaccard(gt_box, anchor_shapes)
#-------------------------------------------------------# # 计算重合度最大的先验框是哪个 # num_true_box, #-------------------------------------------------------# best_ns = torch.argmax(anch_ious,dim=-1) for i, best_n in enumerate(best_ns): if best_n not in anchor_index: continue #-------------------------------------------------------------# # 取出各类坐标: # gi和gj代表的是真实框对应的特征点的x轴y轴坐标 # gx和gy代表真实框的x轴和y轴坐标 # gw和gh代表真实框的宽和高 #-------------------------------------------------------------# gi = gis[i].long() gj = gjs[i].long() gx = gxs[i] gy = gys[i] gw = gws[i] gh = ghs[i] if (gj < in_h) and (gi < in_w): best_n = best_n - subtract_index #----------------------------------------# # noobj_mask代表无目标的特征点 #----------------------------------------# noobj_mask[b, best_n, gj, gi] = 0 #----------------------------------------# # mask代表有目标的特征点 #----------------------------------------# mask[b, best_n, gj, gi] = 1 #----------------------------------------# # tx、ty代表中心的真实值 #----------------------------------------# tx[b, best_n, gj, gi] = gx ty[b, best_n, gj, gi] = gy #----------------------------------------# # tw、th代表宽高的真实值 #----------------------------------------# tw[b, best_n, gj, gi] = gw th[b, best_n, gj, gi] = gh #----------------------------------------# # 用于获得xywh的比例 # 大目标loss权重小,小目标loss权重大 #----------------------------------------# box_loss_scale_x[b, best_n, gj, gi] = target[b][i, 2] box_loss_scale_y[b, best_n, gj, gi] = target[b][i, 3] #----------------------------------------# # tconf代表物体置信度 #----------------------------------------# tconf[b, best_n, gj, gi] = 1 #----------------------------------------# # tcls代表种类置信度 #----------------------------------------# tcls[b, best_n, gj, gi, target[b][i, 4].long()] = 1 else: print('Step {0} out of bound'.format(b)) print('gj: {0}, height: {1} | gi: {2}, width: {3}'.format(gj, in_h, gi, in_w)) continue t_box[...,0] = tx t_box[...,1] = ty t_box[...,2] = tw t_box[...,3] = th return mask, noobj_mask, t_box, tconf, tcls, box_loss_scale_x, box_loss_scale_y
def get_ignore(self,prediction,target,scaled_anchors,in_w, in_h,noobj_mask): #-----------------------------------------------------# # 计算一共有多少张图片 #-----------------------------------------------------# bs = len(target) #-------------------------------------------------------# # 获得当前特征层先验框所属的编号,方便后面对先验框筛选 #-------------------------------------------------------# anchor_index = [[0,1,2],[3,4,5],[6,7,8],[9,10,11],[12,13,14]][self.feature_length.index(in_w)] scaled_anchors = np.array(scaled_anchors)[anchor_index] # 先验框的中心位置的调整参数 x = torch.sigmoid(prediction[..., 0]) y = torch.sigmoid(prediction[..., 1]) # 先验框的宽高调整参数 w = prediction[..., 2] # Width h = prediction[..., 3] # Height
FloatTensor = torch.cuda.FloatTensor if x.is_cuda else torch.FloatTensor LongTensor = torch.cuda.LongTensor if x.is_cuda else torch.LongTensor
# 生成网格,先验框中心,网格左上角 grid_x = torch.linspace(0, in_w - 1, in_w).repeat(in_h, 1).repeat( int(bs*self.num_anchors/5), 1, 1).view(x.shape).type(FloatTensor) grid_y = torch.linspace(0, in_h - 1, in_h).repeat(in_w, 1).t().repeat( int(bs*self.num_anchors/5), 1, 1).view(y.shape).type(FloatTensor)
# 生成先验框的宽高 anchor_w = FloatTensor(scaled_anchors).index_select(1, LongTensor([0])) anchor_h = FloatTensor(scaled_anchors).index_select(1, LongTensor([1])) anchor_w = anchor_w.repeat(bs, 1).repeat(1, 1, in_h * in_w).view(w.shape) anchor_h = anchor_h.repeat(bs, 1).repeat(1, 1, in_h * in_w).view(h.shape) #-------------------------------------------------------# # 计算调整后的先验框中心与宽高 #-------------------------------------------------------# pred_boxes = FloatTensor(prediction[..., :4].shape) pred_boxes[..., 0] = x + grid_x pred_boxes[..., 1] = y + grid_y pred_boxes[..., 2] = torch.exp(w) * anchor_w pred_boxes[..., 3] = torch.exp(h) * anchor_h for i in range(bs): pred_boxes_for_ignore = pred_boxes[i] #-------------------------------------------------------# # 将预测结果转换一个形式 # pred_boxes_for_ignore num_anchors, 4 #-------------------------------------------------------# pred_boxes_for_ignore = pred_boxes_for_ignore.view(-1, 4) #-------------------------------------------------------# # 计算真实框,并把真实框转换成相对于特征层的大小 # gt_box num_true_box, 4 #-------------------------------------------------------# if len(target[i]) > 0: gx = target[i][:, 0:1] * in_w gy = target[i][:, 1:2] * in_h gw = target[i][:, 2:3] * in_w gh = target[i][:, 3:4] * in_h gt_box = torch.FloatTensor(torch.cat([gx, gy, gw, gh],-1)).type(FloatTensor)
#-------------------------------------------------------# # 计算交并比 # anch_ious num_true_box, num_anchors #-------------------------------------------------------# anch_ious = jaccard(gt_box, pred_boxes_for_ignore) #-------------------------------------------------------# # 每个先验框对应真实框的最大重合度 # anch_ious_max num_anchors #-------------------------------------------------------# anch_ious_max, _ = torch.max(anch_ious,dim=0) anch_ious_max = anch_ious_max.view(pred_boxes[i].size()[:3]) noobj_mask[i][anch_ious_max>self.ignore_threshold] = 0 return noobj_mask, pred_boxes
def rand(a=0, b=1): return np.random.rand()*(b-a) + a
class Generator(object): def __init__(self,batch_size, train_lines, image_size, ): self.batch_size = batch_size self.train_lines = train_lines self.train_batches = len(train_lines) self.image_size = image_size def get_random_data(self, annotation_line, input_shape, jitter=.3, hue=.1, sat=1.5, val=1.5, random=True): '''r实时数据增强的随机预处理''' line = annotation_line.split() image = Image.open(line[0]) iw, ih = image.size h, w = input_shape box = np.array([np.array(list(map(int,box.split(',')))) for box in line[1:]])
if not random: scale = min(w/iw, h/ih) nw = int(iw*scale) nh = int(ih*scale) dx = (w-nw)//2 dy = (h-nh)//2
image = image.resize((nw,nh), Image.BICUBIC) new_image = Image.new('RGB', (w,h), (128,128,128)) new_image.paste(image, (dx, dy)) image_data = np.array(new_image, np.float32)
# 调整目标框坐标 box_data = np.zeros((len(box), 5)) if len(box) > 0: np.random.shuffle(box) box[:, [0, 2]] = box[:, [0, 2]] * nw / iw + dx box[:, [1, 3]] = box[:, [1, 3]] * nh / ih + dy box[:, 0:2][box[:, 0:2] < 0] = 0 box[:, 2][box[:, 2] > w] = w box[:, 3][box[:, 3] > h] = h box_w = box[:, 2] - box[:, 0] box_h = box[:, 3] - box[:, 1] box = box[np.logical_and(box_w > 1, box_h > 1)] # 保留有效框 box_data = np.zeros((len(box), 5)) box_data[:len(box)] = box
return image_data, box_data
# resize image new_ar = w/h * rand(1-jitter,1+jitter)/rand(1-jitter,1+jitter) scale = rand(.25, 2) if new_ar < 1: nh = int(scale*h) nw = int(nh*new_ar) else: nw = int(scale*w) nh = int(nw/new_ar) image = image.resize((nw,nh), Image.BICUBIC)
# place image dx = int(rand(0, w-nw)) dy = int(rand(0, h-nh)) new_image = Image.new('RGB', (w,h), (128,128,128)) new_image.paste(image, (dx, dy)) image = new_image
# flip image or not flip = rand()<.5 if flip: image = image.transpose(Image.FLIP_LEFT_RIGHT)
# distort image hue = rand(-hue, hue) sat = rand(1, sat) if rand()<.5 else 1/rand(1, sat) val = rand(1, val) if rand()<.5 else 1/rand(1, val) x = cv2.cvtColor(np.array(image,np.float32)/255, cv2.COLOR_RGB2HSV) x[..., 0] += hue*360 x[..., 0][x[..., 0]>1] -= 1 x[..., 0][x[..., 0]<0] += 1 x[..., 1] *= sat x[..., 2] *= val x[x[:,:, 0]>360, 0] = 360 x[:, :, 1:][x[:, :, 1:]>1] = 1 x[x<0] = 0 image_data = cv2.cvtColor(x, cv2.COLOR_HSV2RGB)*255
# correct boxes box_data = np.zeros((len(box),5)) if len(box)>0: np.random.shuffle(box) box[:, [0,2]] = box[:, [0,2]]*nw/iw + dx box[:, [1,3]] = box[:, [1,3]]*nh/ih + dy if flip: box[:, [0,2]] = w - box[:, [2,0]] box[:, 0:2][box[:, 0:2]<0] = 0 box[:, 2][box[:, 2]>w] = w box[:, 3][box[:, 3]>h] = h box_w = box[:, 2] - box[:, 0] box_h = box[:, 3] - box[:, 1] box = box[np.logical_and(box_w>1, box_h>1)] # discard invalid box box_data = np.zeros((len(box),5)) box_data[:len(box)] = box
return image_data, box_data
def get_random_data_with_Mosaic(self, annotation_line, input_shape, hue=.1, sat=1.5, val=1.5): '''random preprocessing for real-time data augmentation''' h, w = input_shape min_offset_x = 0.3 min_offset_y = 0.3 scale_low = 1-min(min_offset_x,min_offset_y) scale_high = scale_low+0.2
image_datas = [] box_datas = [] index = 0
place_x = [0,0,int(w*min_offset_x),int(w*min_offset_x)] place_y = [0,int(h*min_offset_y),int(h*min_offset_y),0] for line in annotation_line: # 每一行进行分割 line_content = line.split() # 打开图片 image = Image.open(line_content[0]) image = image.convert("RGB") # 图片的大小 iw, ih = image.size # 保存框的位置 box = np.array([np.array(list(map(int,box.split(',')))) for box in line_content[1:]]) # 是否翻转图片 flip = rand()<.5 if flip and len(box)>0: image = image.transpose(Image.FLIP_LEFT_RIGHT) box[:, [0,2]] = iw - box[:, [2,0]]
# 对输入进来的图片进行缩放 new_ar = w/h scale = rand(scale_low, scale_high) if new_ar < 1: nh = int(scale*h) nw = int(nh*new_ar) else: nw = int(scale*w) nh = int(nw/new_ar) image = image.resize((nw,nh), Image.BICUBIC)
# 进行色域变换 hue = rand(-hue, hue) sat = rand(1, sat) if rand()<.5 else 1/rand(1, sat) val = rand(1, val) if rand()<.5 else 1/rand(1, val) x = cv2.cvtColor(np.array(image,np.float32)/255, cv2.COLOR_RGB2HSV) x[..., 0] += hue*360 x[..., 0][x[..., 0]>1] -= 1 x[..., 0][x[..., 0]<0] += 1 x[..., 1] *= sat x[..., 2] *= val x[x[:,:, 0]>360, 0] = 360 x[:, :, 1:][x[:, :, 1:]>1] = 1 x[x<0] = 0 image = cv2.cvtColor(x, cv2.COLOR_HSV2RGB) # numpy array, 0 to 1 image = Image.fromarray((image*255).astype(np.uint8)) # 将图片进行放置,分别对应四张分割图片的位置 dx = place_x[index] dy = place_y[index] new_image = Image.new('RGB', (w,h), (128,128,128)) new_image.paste(image, (dx, dy)) image_data = np.array(new_image)
index = index + 1 box_data = [] # 对box进行重新处理 if len(box)>0: np.random.shuffle(box) box[:, [0,2]] = box[:, [0,2]]*nw/iw + dx box[:, [1,3]] = box[:, [1,3]]*nh/ih + dy box[:, 0:2][box[:, 0:2]<0] = 0 box[:, 2][box[:, 2]>w] = w box[:, 3][box[:, 3]>h] = h box_w = box[:, 2] - box[:, 0] box_h = box[:, 3] - box[:, 1] box = box[np.logical_and(box_w>1, box_h>1)] box_data = np.zeros((len(box),5)) box_data[:len(box)] = box image_datas.append(image_data) box_datas.append(box_data)
# 将图片分割,放在一起 cutx = np.random.randint(int(w*min_offset_x), int(w*(1 - min_offset_x))) cuty = np.random.randint(int(h*min_offset_y), int(h*(1 - min_offset_y)))
new_image = np.zeros([h,w,3]) new_image[:cuty, :cutx, :] = image_datas[0][:cuty, :cutx, :] new_image[cuty:, :cutx, :] = image_datas[1][cuty:, :cutx, :] new_image[cuty:, cutx:, :] = image_datas[2][cuty:, cutx:, :] new_image[:cuty, cutx:, :] = image_datas[3][:cuty, cutx:, :]
# 对框进行进一步的处理 new_boxes = np.array(merge_bboxes(box_datas, cutx, cuty))
if len(new_boxes) == 0: return new_image, [] if (new_boxes[:,:4]>0).any(): return new_image, new_boxes else: return new_image, []
def generate(self, train = True, mosaic = True): while True: shuffle(self.train_lines) lines = self.train_lines inputs = [] targets = [] flag = True n = len(lines) for i in range(len(lines)): if mosaic == True: if flag and (i+4) < n: img,y = self.get_random_data_with_Mosaic(lines[i:i+4], self.image_size[0:2]) i = (i+4) % n else: img,y = self.get_random_data(lines[i], self.image_size[0:2], random=train) i = (i+1) % n flag = bool(1-flag) else: img,y = self.get_random_data(lines[i], self.image_size[0:2], random=train) i = (i+1) % n if len(y)!=0: boxes = np.array(y[:,:4],dtype=np.float32) boxes[:,0] = boxes[:,0]/self.image_size[1] boxes[:,1] = boxes[:,1]/self.image_size[0] boxes[:,2] = boxes[:,2]/self.image_size[1] boxes[:,3] = boxes[:,3]/self.image_size[0]
boxes = np.maximum(np.minimum(boxes,1),0) boxes[:,2] = boxes[:,2] - boxes[:,0] boxes[:,3] = boxes[:,3] - boxes[:,1] boxes[:,0] = boxes[:,0] + boxes[:,2]/2 boxes[:,1] = boxes[:,1] + boxes[:,3]/2 y = np.concatenate([boxes,y[:,-1:]],axis=-1) img = np.array(img,dtype = np.float32)
inputs.append(np.transpose(img/255.0,(2,0,1))) targets.append(np.array(y,dtype = np.float32)) if len(targets) == self.batch_size: tmp_inp = np.array(inputs) tmp_targets = targets inputs = [] targets = [] yield tmp_inp, tmp_targets12this is the yolov4 with 1 deeper downsampling(2 times) in cspdarknet50. 1 bifpn123456789101112131415161718192021222324252627'''predict.py有几个注意点1、该代码无法直接进行批量预测,如果想要批量预测,可以利用os.listdir()遍历文件夹,利用Image.open打开图片文件进行预测。具体流程可以参考get_dr_txt.py,在get_dr_txt.py即实现了遍历还实现了目标信息的保存。2、如果想要进行检测完的图片的保存,利用r_image.save("img.jpg")即可保存,直接在predict.py里进行修改即可。 3、如果想要获得预测框的坐标,可以进入yolo.detect_image函数,在绘图部分读取top,left,bottom,right这四个值。4、如果想要利用预测框截取下目标,可以进入yolo.detect_image函数,在绘图部分利用获取到的top,left,bottom,right这四个值在原图上利用矩阵的方式进行截取。5、如果想要在预测图上写额外的字,比如检测到的特定目标的数量,可以进入yolo.detect_image函数,在绘图部分对predicted_class进行判断,比如判断if predicted_class == 'car': 即可判断当前目标是否为车,然后记录数量即可。利用draw.text即可写字。'''from PIL import Image
from yolo import YOLO
yolo = YOLO()
while True: img = input('Input image filename:') try: image = Image.open(img) except: print('Open Error! Try again!') continue else: r_image = yolo.detect_image(image) r_image.show()12345678910111213141516#--------------------------------------------## 该部分代码只用于看网络结构,并非测试代码# map测试请看get_dr_txt.py、get_gt_txt.py# 和get_map.py#--------------------------------------------#import torchfrom torchsummary import summary
from nets.CSPdarknet import darknet53from nets.yolo4 import YoloBody
if __name__ == "__main__": # 需要使用device来指定网络在GPU还是CPU运行 device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') model = YoloBody(3,20).to(device) summary(model, input_size=(3, 416, 416))123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315#-------------------------------------## 对数据集进行训练#-------------------------------------#import osimport time
import numpy as npimport torchimport torch.backends.cudnn as cudnnimport torch.nn as nnimport torch.nn.functional as Fimport torch.optim as optimfrom torch.autograd import Variablefrom torch.utils.data import DataLoaderfrom tqdm import tqdm
from nets.yolo4 import YoloBodyfrom nets.yolo_training import Generator, YOLOLossfrom utils.dataloader import YoloDataset, yolo_dataset_collate
#---------------------------------------------------## 获得类和先验框#---------------------------------------------------#def get_classes(classes_path): '''loads the classes''' with open(classes_path) as f: class_names = f.readlines() class_names = [c.strip() for c in class_names] return class_names
def get_anchors(anchors_path): '''loads the anchors from a file''' with open(anchors_path) as f: anchors = f.readline() anchors = [float(x) for x in anchors.split(',')] return np.array(anchors).reshape([-1,3,2])[::-1,:,:]
def get_lr(optimizer): for param_group in optimizer.param_groups: return param_group['lr']
def fit_one_epoch(net,yolo_losses,epoch,epoch_size,epoch_size_val,gen,genval,Epoch,cuda): total_loss = 0 val_loss = 0
net.train() with tqdm(total=epoch_size,desc=f'Epoch {epoch + 1}/{Epoch}',postfix=dict,mininterval=0.3) as pbar: for iteration, batch in enumerate(gen): if iteration >= epoch_size: break images, targets = batch[0], batch[1] with torch.no_grad(): if cuda: images = Variable(torch.from_numpy(images).type(torch.FloatTensor)).cuda() targets = [Variable(torch.from_numpy(ann).type(torch.FloatTensor)) for ann in targets] else: images = Variable(torch.from_numpy(images).type(torch.FloatTensor)) targets = [Variable(torch.from_numpy(ann).type(torch.FloatTensor)) for ann in targets]
#----------------------# # 清零梯度 #----------------------# optimizer.zero_grad() #----------------------# # 前向传播 #----------------------# outputs = net(images) losses = [] num_pos_all = 0 #----------------------# # 计算损失 #----------------------# for i in range(5): loss_item, num_pos = yolo_losses[i](outputs[i], targets) losses.append(loss_item) num_pos_all += num_pos
loss = sum(losses) / num_pos_all #----------------------# # 反向传播 #----------------------# loss.backward() optimizer.step()
total_loss += loss.item() pbar.set_postfix(**{'total_loss': total_loss / (iteration + 1), 'lr' : get_lr(optimizer)}) pbar.update(1)
net.eval() print('Start Validation') with tqdm(total=epoch_size_val, desc=f'Epoch {epoch + 1}/{Epoch}',postfix=dict,mininterval=0.3) as pbar: for iteration, batch in enumerate(genval): if iteration >= epoch_size_val: break images_val, targets_val = batch[0], batch[1]
with torch.no_grad(): if cuda: images_val = Variable(torch.from_numpy(images_val).type(torch.FloatTensor)).cuda() targets_val = [Variable(torch.from_numpy(ann).type(torch.FloatTensor)) for ann in targets_val] else: images_val = Variable(torch.from_numpy(images_val).type(torch.FloatTensor)) targets_val = [Variable(torch.from_numpy(ann).type(torch.FloatTensor)) for ann in targets_val] optimizer.zero_grad() outputs = net(images_val) losses = [] num_pos_all = 0 for i in range(5): loss_item, num_pos = yolo_losses[i](outputs[i], targets_val) losses.append(loss_item) num_pos_all += num_pos loss = sum(losses) / num_pos_all val_loss += loss.item() pbar.set_postfix(**{'total_loss': val_loss / (iteration + 1)}) pbar.update(1) print('Finish Validation') print('Epoch:'+ str(epoch+1) + '/' + str(Epoch)) print('Total Loss: %.4f || Val Loss: %.4f ' % (total_loss/(epoch_size+1),val_loss/(epoch_size_val+1)))
print('Saving state, iter:', str(epoch+1)) torch.save(model.state_dict(), 'logs/Epoch%d-Total_Loss%.4f-Val_Loss%.4f.pth'%((epoch+1),total_loss/(epoch_size+1),val_loss/(epoch_size_val+1)))
#----------------------------------------------------## 检测精度mAP和pr曲线计算参考视频# https://www.bilibili.com/video/BV1zE411u7Vw#----------------------------------------------------#if __name__ == "__main__": #-------------------------------# # 是否使用Cuda # 没有GPU可以设置成False #-------------------------------# Cuda =True #-------------------------------# # Dataloder的使用 #-------------------------------# Use_Data_Loader = True #------------------------------------------------------# # 是否对损失进行归一化,用于改变loss的大小 # 用于决定计算最终loss是除上batch_size还是除上正样本数量 #------------------------------------------------------# normalize = False #-------------------------------# # 输入的shape大小 # 显存比较小可以使用416x416 # 显存比较大可以使用608x608 #-------------------------------# input_shape = (512,512)
#----------------------------------------------------# # classes和anchor的路径,非常重要 # 训练前一定要修改classes_path,使其对应自己的数据集 #----------------------------------------------------# anchors_path = 'model_data/yolo_anchors.txt' classes_path = 'model_data/voc_classes.txt' #----------------------------------------------------# # 获取classes和anchor #----------------------------------------------------# class_names = get_classes(classes_path) anchors = get_anchors(anchors_path) num_classes = len(class_names) #------------------------------------------------------# # Yolov4的tricks应用 # mosaic 马赛克数据增强 True or False # 实际测试时mosaic数据增强并不稳定,所以默认为False # Cosine_scheduler 余弦退火学习率 True or False # label_smoothing 标签平滑 0.01以下一般 如0.01、0.005 #------------------------------------------------------# mosaic = False Cosine_lr = False smoooth_label = 0
#------------------------------------------------------# # 创建yolo模型 # 训练前一定要修改classes_path和对应的txt文件 #------------------------------------------------------# model = YoloBody(len(anchors[0]), num_classes)
#------------------------------------------------------# # 权值文件请看README,百度网盘下载 #------------------------------------------------------# model_path = "model_data/yolo4_voc_weights.pth" print('Loading weights into state dict...') device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') model_dict = model.state_dict() pretrained_dict = torch.load(model_path, map_location=device) pretrained_dict = {k: v for k, v in pretrained_dict.items() if np.shape(model_dict[k]) == np.shape(v)} model_dict.update(pretrained_dict) model.load_state_dict(model_dict) print('Finished!')
net = model.train()
if Cuda: net = torch.nn.DataParallel(model) cudnn.benchmark = True net = net.cuda()
# 建立loss函数 yolo_losses = [] for i in range(5): yolo_losses.append(YOLOLoss(np.reshape(anchors,[-1,2]),num_classes, \ (input_shape[1], input_shape[0]), smoooth_label, Cuda, normalize))
#----------------------------------------------------# # 获得图片路径和标签 #----------------------------------------------------# annotation_path = '2007_train.txt' #----------------------------------------------------------------------# # 验证集的划分在train.py代码里面进行 # 2007_test.txt和2007_val.txt里面没有内容是正常的。训练不会使用到。 # 当前划分方式下,验证集和训练集的比例为1:9 #----------------------------------------------------------------------# val_split = 0.1 with open(annotation_path) as f: lines = f.readlines() np.random.seed(10101) np.random.shuffle(lines) np.random.seed(None) num_val = int(len(lines)*val_split) num_train = len(lines) - num_val #------------------------------------------------------# # 主干特征提取网络特征通用,冻结训练可以加快训练速度 # 也可以在训练初期防止权值被破坏。 # Init_Epoch为起始世代 # Freeze_Epoch为冻结训练的世代 # Epoch总训练世代 # 提示OOM或者显存不足请调小Batch_size #------------------------------------------------------# if True: lr = 1e-3 Batch_size = 16 Init_Epoch = 0 Freeze_Epoch = 50 #----------------------------------------------------------------------------# # 我在实际测试时,发现optimizer的weight_decay起到了反作用, # 所以去除掉了weight_decay,大家也可以开起来试试,一般是weight_decay=5e-4 #----------------------------------------------------------------------------# optimizer = optim.Adam(net.parameters(),lr) if Cosine_lr: lr_scheduler = optim.lr_scheduler.CosineAnnealingLR(optimizer, T_max=5, eta_min=1e-5) else: lr_scheduler = optim.lr_scheduler.StepLR(optimizer,step_size=1,gamma=0.92)
if Use_Data_Loader: train_dataset = YoloDataset(lines[:num_train], (input_shape[0], input_shape[1]), mosaic=mosaic, is_train=True) val_dataset = YoloDataset(lines[num_train:], (input_shape[0], input_shape[1]), mosaic=False, is_train=False) gen = DataLoader(train_dataset, shuffle=True, batch_size=Batch_size, num_workers=4, pin_memory=True, drop_last=True, collate_fn=yolo_dataset_collate) gen_val = DataLoader(val_dataset, shuffle=True, batch_size=Batch_size, num_workers=4,pin_memory=True, drop_last=True, collate_fn=yolo_dataset_collate) else: gen = Generator(Batch_size, lines[:num_train], (input_shape[0], input_shape[1])).generate(train=True, mosaic = mosaic) gen_val = Generator(Batch_size, lines[num_train:], (input_shape[0], input_shape[1])).generate(train=False, mosaic = mosaic)
epoch_size = max(1, num_train//Batch_size) epoch_size_val = num_val//Batch_size #------------------------------------# # 冻结一定部分训练 #------------------------------------# for param in model.backbone.parameters(): param.requires_grad = False
for epoch in range(Init_Epoch,Freeze_Epoch): fit_one_epoch(net,yolo_losses,epoch,epoch_size,epoch_size_val,gen,gen_val,Freeze_Epoch,Cuda) lr_scheduler.step()
if True: lr = 1e-4 Batch_size = 8 Freeze_Epoch = 50 Unfreeze_Epoch = 120
#----------------------------------------------------------------------------# # 我在实际测试时,发现optimizer的weight_decay起到了反作用, # 所以去除掉了weight_decay,大家也可以开起来试试,一般是weight_decay=5e-4 #----------------------------------------------------------------------------# optimizer = optim.Adam(net.parameters(),lr) if Cosine_lr: lr_scheduler = optim.lr_scheduler.CosineAnnealingLR(optimizer, T_max=5, eta_min=1e-5) else: lr_scheduler = optim.lr_scheduler.StepLR(optimizer,step_size=1,gamma=0.92)
if Use_Data_Loader: train_dataset = YoloDataset(lines[:num_train], (input_shape[0], input_shape[1]), mosaic=mosaic, is_train=True) val_dataset = YoloDataset(lines[num_train:], (input_shape[0], input_shape[1]), mosaic=False, is_train=False) gen = DataLoader(train_dataset, shuffle=True, batch_size=Batch_size, num_workers=4, pin_memory=True, drop_last=True, collate_fn=yolo_dataset_collate) gen_val = DataLoader(val_dataset, shuffle=True, batch_size=Batch_size, num_workers=4,pin_memory=True, drop_last=True, collate_fn=yolo_dataset_collate) else: gen = Generator(Batch_size, lines[:num_train], (input_shape[0], input_shape[1])).generate(train=True, mosaic = mosaic) gen_val = Generator(Batch_size, lines[num_train:], (input_shape[0], input_shape[1])).generate(train=False, mosaic = mosaic)
epoch_size = max(1, num_train//Batch_size) epoch_size_val = num_val//Batch_size #------------------------------------# # 解冻后训练 #------------------------------------# for param in model.backbone.parameters(): param.requires_grad = True
for epoch in range(Freeze_Epoch,Unfreeze_Epoch): fit_one_epoch(net,yolo_losses,epoch,epoch_size,epoch_size_val,gen,gen_val,Unfreeze_Epoch,Cuda) lr_scheduler.step()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334#-------------------------------------## 对数据集进行训练#-------------------------------------#import osimport numpy as npimport timeimport torchfrom torch.autograd import Variableimport torch.nn as nnimport torch.optim as optimimport torch.nn.functional as Fimport torch.backends.cudnn as cudnnfrom torch.utils.data import DataLoaderfrom utils.dataloader import yolo_dataset_collate, YoloDatasetfrom nets.yolo_training import YOLOLoss,Generatorfrom nets.yolo4 import YoloBodyfrom tensorboardX import SummaryWriterfrom tqdm import tqdm
#---------------------------------------------------## 获得类和先验框#---------------------------------------------------#def get_classes(classes_path): '''loads the classes''' with open(classes_path) as f: class_names = f.readlines() class_names = [c.strip() for c in class_names] return class_names
def get_anchors(anchors_path): '''loads the anchors from a file''' with open(anchors_path) as f: anchors = f.readline() anchors = [float(x) for x in anchors.split(',')] return np.array(anchors).reshape([-1,3,2])[::-1,:,:]
def get_lr(optimizer): for param_group in optimizer.param_groups: return param_group['lr']
def fit_ont_epoch(net,yolo_losses,epoch,epoch_size,epoch_size_val,gen,genval,Epoch,cuda,writer): global train_tensorboard_step, val_tensorboard_step total_loss = 0 val_loss = 0
net.train() with tqdm(total=epoch_size,desc=f'Epoch {epoch + 1}/{Epoch}',postfix=dict,mininterval=0.3) as pbar: for iteration, batch in enumerate(gen): if iteration >= epoch_size: break images, targets = batch[0], batch[1] with torch.no_grad(): if cuda: images = Variable(torch.from_numpy(images).type(torch.FloatTensor)).cuda() targets = [Variable(torch.from_numpy(ann).type(torch.FloatTensor)) for ann in targets] else: images = Variable(torch.from_numpy(images).type(torch.FloatTensor)) targets = [Variable(torch.from_numpy(ann).type(torch.FloatTensor)) for ann in targets]
#----------------------# # 清零梯度 #----------------------# optimizer.zero_grad() #----------------------# # 前向传播 #----------------------# outputs = net(images) losses = [] num_pos_all = 0 #----------------------# # 计算损失 #----------------------# for i in range(3): loss_item, num_pos = yolo_losses[i](outputs[i], targets) losses.append(loss_item) num_pos_all += num_pos
loss = sum(losses) / num_pos_all total_loss += loss.item()
#----------------------# # 反向传播 #----------------------# loss.backward() optimizer.step()
# 将loss写入tensorboard,每一步都写 writer.add_scalar('Train_loss', loss, train_tensorboard_step) train_tensorboard_step += 1
pbar.set_postfix(**{'total_loss': total_loss / (iteration + 1), 'lr' : get_lr(optimizer)}) pbar.update(1) # 将loss写入tensorboard,下面注释的是每个世代保存一次 # writer.add_scalar('Train_loss', total_loss/(iteration+1), epoch) net.eval() print('Start Validation') with tqdm(total=epoch_size_val, desc=f'Epoch {epoch + 1}/{Epoch}',postfix=dict,mininterval=0.3) as pbar: for iteration, batch in enumerate(genval): if iteration >= epoch_size_val: break images_val, targets_val = batch[0], batch[1]
with torch.no_grad(): if cuda: images_val = Variable(torch.from_numpy(images_val).type(torch.FloatTensor)).cuda() targets_val = [Variable(torch.from_numpy(ann).type(torch.FloatTensor)) for ann in targets_val] else: images_val = Variable(torch.from_numpy(images_val).type(torch.FloatTensor)) targets_val = [Variable(torch.from_numpy(ann).type(torch.FloatTensor)) for ann in targets_val] optimizer.zero_grad() outputs = net(images_val) losses = [] num_pos_all = 0 for i in range(3): loss_item, num_pos = yolo_losses[i](outputs[i], targets_val) losses.append(loss_item) num_pos_all += num_pos
loss = sum(losses) / num_pos_all val_loss += loss.item()
# 将loss写入tensorboard, 下面注释的是每一步都写 # writer.add_scalar('Val_loss', loss, val_tensorboard_step) # val_tensorboard_step += 1
pbar.set_postfix(**{'total_loss': val_loss / (iteration + 1)}) pbar.update(1)
# 将loss写入tensorboard,每个世代保存一次 writer.add_scalar('Val_loss',val_loss / (epoch_size_val+1), epoch) print('Finish Validation') print('Epoch:'+ str(epoch+1) + '/' + str(Epoch)) print('Total Loss: %.4f || Val Loss: %.4f ' % (total_loss/(epoch_size+1),val_loss/(epoch_size_val+1)))
print('Saving state, iter:', str(epoch+1)) torch.save(model.state_dict(), 'logs/Epoch%d-Total_Loss%.4f-Val_Loss%.4f.pth'%((epoch+1),total_loss/(epoch_size+1),val_loss/(epoch_size_val+1)))
if __name__ == "__main__": #-------------------------------# # 是否使用Cuda # 没有GPU可以设置成False #-------------------------------# Cuda = True #-------------------------------# # Dataloder的使用 #-------------------------------# Use_Data_Loader = True #------------------------------------------------------# # 是否对损失进行归一化,用于改变loss的大小 # 用于决定计算最终loss是除上batch_size还是除上正样本数量 #------------------------------------------------------# normalize = False #-------------------------------# # 输入的shape大小 # 显存比较小可以使用416x416 # 显存比较大可以使用608x608 #-------------------------------# input_shape = (416,416)
#----------------------------------------------------# # classes和anchor的路径,非常重要 # 训练前一定要修改classes_path,使其对应自己的数据集 #----------------------------------------------------# anchors_path = 'model_data/yolo_anchors.txt' classes_path = 'model_data/voc_classes.txt' #----------------------------------------------------# # 获取classes和anchor #----------------------------------------------------# class_names = get_classes(classes_path) anchors = get_anchors(anchors_path) num_classes = len(class_names) #------------------------------------------------------# # Yolov4的tricks应用 # mosaic 马赛克数据增强 True or False # 实际测试时mosaic数据增强并不稳定,所以默认为False # Cosine_scheduler 余弦退火学习率 True or False # label_smoothing 标签平滑 0.01以下一般 如0.01、0.005 #------------------------------------------------------# mosaic = False Cosine_lr = False smoooth_label = 0
#------------------------------------------------------# # 创建yolo模型 # 训练前一定要修改classes_path和对应的txt文件 #------------------------------------------------------# model = YoloBody(len(anchors[0]), num_classes)
#------------------------------------------------------# # 权值文件请看README,百度网盘下载 #------------------------------------------------------# model_path = "model_data/yolo4_weights.pth" print('Loading weights into state dict...') device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') model_dict = model.state_dict() pretrained_dict = torch.load(model_path, map_location=device) pretrained_dict = {k: v for k, v in pretrained_dict.items() if np.shape(model_dict[k]) == np.shape(v)} model_dict.update(pretrained_dict) model.load_state_dict(model_dict) print('Finished!')
net = model.train()
if Cuda: net = torch.nn.DataParallel(model) cudnn.benchmark = True net = net.cuda()
# 建立loss函数 yolo_losses = [] for i in range(3): yolo_losses.append(YOLOLoss(np.reshape(anchors,[-1,2]),num_classes, \ (input_shape[1], input_shape[0]), smoooth_label, Cuda, normalize))
#----------------------------------------------------# # 获得图片路径和标签 #----------------------------------------------------# annotation_path = '2007_train.txt' #----------------------------------------------------------------------# # 验证集的划分在train.py代码里面进行 # 2007_test.txt和2007_val.txt里面没有内容是正常的。训练不会使用到。 # 当前划分方式下,验证集和训练集的比例为1:9 #----------------------------------------------------------------------# val_split = 0.1 with open(annotation_path) as f: lines = f.readlines() np.random.seed(10101) np.random.shuffle(lines) np.random.seed(None) num_val = int(len(lines)*val_split) num_train = len(lines) - num_val
writer = SummaryWriter(log_dir='logs',flush_secs=60) if Cuda: graph_inputs = torch.from_numpy(np.random.rand(1,3,input_shape[0],input_shape[1])).type(torch.FloatTensor).cuda() else: graph_inputs = torch.from_numpy(np.random.rand(1,3,input_shape[0],input_shape[1])).type(torch.FloatTensor) writer.add_graph(model, (graph_inputs,))
#------------------------------------------------------# # 主干特征提取网络特征通用,冻结训练可以加快训练速度 # 也可以在训练初期防止权值被破坏。 # Init_Epoch为起始世代 # Freeze_Epoch为冻结训练的世代 # Epoch总训练世代 # 提示OOM或者显存不足请调小Batch_size #------------------------------------------------------# train_tensorboard_step = 1 val_tensorboard_step = 1 if True: lr = 1e-3 Batch_size = 4 Init_Epoch = 0 Freeze_Epoch = 50 #----------------------------------------------------------------------------# # 我在实际测试时,发现optimizer的weight_decay起到了反作用, # 所以去除掉了weight_decay,大家也可以开起来试试,一般是weight_decay=5e-4 #----------------------------------------------------------------------------# optimizer = optim.Adam(net.parameters(),lr) if Cosine_lr: lr_scheduler = optim.lr_scheduler.CosineAnnealingLR(optimizer, T_max=5, eta_min=1e-5) else: lr_scheduler = optim.lr_scheduler.StepLR(optimizer,step_size=1,gamma=0.92)
if Use_Data_Loader: train_dataset = YoloDataset(lines[:num_train], (input_shape[0], input_shape[1]), mosaic=mosaic, is_train=True) val_dataset = YoloDataset(lines[num_train:], (input_shape[0], input_shape[1]), mosaic=False, is_train=False) gen = DataLoader(train_dataset, shuffle=True, batch_size=Batch_size, num_workers=4, pin_memory=True, drop_last=True, collate_fn=yolo_dataset_collate) gen_val = DataLoader(val_dataset, shuffle=True, batch_size=Batch_size, num_workers=4,pin_memory=True, drop_last=True, collate_fn=yolo_dataset_collate) else: gen = Generator(Batch_size, lines[:num_train], (input_shape[0], input_shape[1])).generate(train=True, mosaic = mosaic) gen_val = Generator(Batch_size, lines[num_train:], (input_shape[0], input_shape[1])).generate(train=False, mosaic = False)
epoch_size = max(1, num_train//Batch_size) epoch_size_val = num_val//Batch_size #------------------------------------# # 冻结一定部分训练 #------------------------------------# for param in model.backbone.parameters(): param.requires_grad = False
for epoch in range(Init_Epoch,Freeze_Epoch): fit_ont_epoch(net,yolo_losses,epoch,epoch_size,epoch_size_val,gen,gen_val,Freeze_Epoch,Cuda,writer) lr_scheduler.step()
if True: lr = 1e-4 Batch_size = 2 Freeze_Epoch = 50 Unfreeze_Epoch = 100
#----------------------------------------------------------------------------# # 我在实际测试时,发现optimizer的weight_decay起到了反作用, # 所以去除掉了weight_decay,大家也可以开起来试试,一般是weight_decay=5e-4 #----------------------------------------------------------------------------# optimizer = optim.Adam(net.parameters(),lr) if Cosine_lr: lr_scheduler = optim.lr_scheduler.CosineAnnealingLR(optimizer, T_max=5, eta_min=1e-5) else: lr_scheduler = optim.lr_scheduler.StepLR(optimizer,step_size=1,gamma=0.92)
if Use_Data_Loader: train_dataset = YoloDataset(lines[:num_train], (input_shape[0], input_shape[1]), mosaic=mosaic, is_train=True) val_dataset = YoloDataset(lines[num_train:], (input_shape[0], input_shape[1]), mosaic=False, is_train=False) gen = DataLoader(train_dataset, shuffle=True, batch_size=Batch_size, num_workers=4, pin_memory=True, drop_last=True, collate_fn=yolo_dataset_collate) gen_val = DataLoader(val_dataset, shuffle=True, batch_size=Batch_size, num_workers=4,pin_memory=True, drop_last=True, collate_fn=yolo_dataset_collate) else: gen = Generator(Batch_size, lines[:num_train], (input_shape[0], input_shape[1])).generate(train=True, mosaic = mosaic) gen_val = Generator(Batch_size, lines[num_train:], (input_shape[0], input_shape[1])).generate(train=False, mosaic = False)
epoch_size = max(1, num_train//Batch_size) epoch_size_val = num_val//Batch_size #------------------------------------# # 解冻后训练 #------------------------------------# for param in model.backbone.parameters(): param.requires_grad = True
for epoch in range(Freeze_Epoch,Unfreeze_Epoch): fit_ont_epoch(net,yolo_losses,epoch,epoch_size,epoch_size_val,gen,gen_val,Unfreeze_Epoch,Cuda,writer) lr_scheduler.step()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272from random import shuffleimport numpy as npimport torchimport torch.nn as nnimport mathimport torch.nn.functional as Ffrom PIL import Imagefrom torch.autograd import Variablefrom torch.utils.data import DataLoaderfrom torch.utils.data.dataset import Datasetfrom utils.utils import bbox_iou, merge_bboxesfrom matplotlib.colors import rgb_to_hsv, hsv_to_rgbfrom nets.yolo_training import Generatorimport cv2
class YoloDataset(Dataset): def __init__(self, train_lines, image_size, mosaic=True, is_train=True): super(YoloDataset, self).__init__()
self.train_lines = train_lines self.train_batches = len(train_lines) self.image_size = image_size self.mosaic = mosaic self.flag = True self.is_train = is_train
def __len__(self): return self.train_batches
def rand(self, a=0, b=1): return np.random.rand() * (b - a) + a
def get_random_data(self, annotation_line, input_shape, jitter=.3, hue=.1, sat=1.5, val=1.5, random=True): """实时数据增强的随机预处理""" line = annotation_line.split() image = Image.open(line[0]) iw, ih = image.size h, w = input_shape box = np.array([np.array(list(map(int, box.split(',')))) for box in line[1:]])
if not random: scale = min(w/iw, h/ih) nw = int(iw*scale) nh = int(ih*scale) dx = (w-nw)//2 dy = (h-nh)//2
image = image.resize((nw,nh), Image.BICUBIC) new_image = Image.new('RGB', (w,h), (128,128,128)) new_image.paste(image, (dx, dy)) image_data = np.array(new_image, np.float32)
# 调整目标框坐标 box_data = np.zeros((len(box), 5)) if len(box) > 0: np.random.shuffle(box) box[:, [0, 2]] = box[:, [0, 2]] * nw / iw + dx box[:, [1, 3]] = box[:, [1, 3]] * nh / ih + dy box[:, 0:2][box[:, 0:2] < 0] = 0 box[:, 2][box[:, 2] > w] = w box[:, 3][box[:, 3] > h] = h box_w = box[:, 2] - box[:, 0] box_h = box[:, 3] - box[:, 1] box = box[np.logical_and(box_w > 1, box_h > 1)] # 保留有效框 box_data = np.zeros((len(box), 5)) box_data[:len(box)] = box
return image_data, box_data
# 调整图片大小 new_ar = w / h * self.rand(1 - jitter, 1 + jitter) / self.rand(1 - jitter, 1 + jitter) scale = self.rand(.25, 2) if new_ar < 1: nh = int(scale * h) nw = int(nh * new_ar) else: nw = int(scale * w) nh = int(nw / new_ar) image = image.resize((nw, nh), Image.BICUBIC)
# 放置图片 dx = int(self.rand(0, w - nw)) dy = int(self.rand(0, h - nh)) new_image = Image.new('RGB', (w, h), (np.random.randint(0, 255), np.random.randint(0, 255), np.random.randint(0, 255))) new_image.paste(image, (dx, dy)) image = new_image
# 是否翻转图片 flip = self.rand() < .5 if flip: image = image.transpose(Image.FLIP_LEFT_RIGHT)
# 色域变换 hue = self.rand(-hue, hue) sat = self.rand(1, sat) if self.rand() < .5 else 1 / self.rand(1, sat) val = self.rand(1, val) if self.rand() < .5 else 1 / self.rand(1, val) x = cv2.cvtColor(np.array(image,np.float32)/255, cv2.COLOR_RGB2HSV) x[..., 0] += hue*360 x[..., 0][x[..., 0]>1] -= 1 x[..., 0][x[..., 0]<0] += 1 x[..., 1] *= sat x[..., 2] *= val x[x[:,:, 0]>360, 0] = 360 x[:, :, 1:][x[:, :, 1:]>1] = 1 x[x<0] = 0 image_data = cv2.cvtColor(x, cv2.COLOR_HSV2RGB)*255
# 调整目标框坐标 box_data = np.zeros((len(box), 5)) if len(box) > 0: np.random.shuffle(box) box[:, [0, 2]] = box[:, [0, 2]] * nw / iw + dx box[:, [1, 3]] = box[:, [1, 3]] * nh / ih + dy if flip: box[:, [0, 2]] = w - box[:, [2, 0]] box[:, 0:2][box[:, 0:2] < 0] = 0 box[:, 2][box[:, 2] > w] = w box[:, 3][box[:, 3] > h] = h box_w = box[:, 2] - box[:, 0] box_h = box[:, 3] - box[:, 1] box = box[np.logical_and(box_w > 1, box_h > 1)] # 保留有效框 box_data = np.zeros((len(box), 5)) box_data[:len(box)] = box
return image_data, box_data
def get_random_data_with_Mosaic(self, annotation_line, input_shape, hue=.1, sat=1.5, val=1.5): h, w = input_shape min_offset_x = 0.3 min_offset_y = 0.3 scale_low = 1 - min(min_offset_x, min_offset_y) scale_high = scale_low + 0.2
image_datas = [] box_datas = [] index = 0
place_x = [0, 0, int(w * min_offset_x), int(w * min_offset_x)] place_y = [0, int(h * min_offset_y), int(h * min_offset_y), 0] for line in annotation_line: # 每一行进行分割 line_content = line.split() # 打开图片 image = Image.open(line_content[0]) image = image.convert("RGB") # 图片的大小 iw, ih = image.size # 保存框的位置 box = np.array([np.array(list(map(int, box.split(',')))) for box in line_content[1:]])
# 是否翻转图片 flip = self.rand() < .5 if flip and len(box) > 0: image = image.transpose(Image.FLIP_LEFT_RIGHT) box[:, [0, 2]] = iw - box[:, [2, 0]]
# 对输入进来的图片进行缩放 new_ar = w / h scale = self.rand(scale_low, scale_high) if new_ar < 1: nh = int(scale * h) nw = int(nh * new_ar) else: nw = int(scale * w) nh = int(nw / new_ar) image = image.resize((nw, nh), Image.BICUBIC)
# 进行色域变换 hue = self.rand(-hue, hue) sat = self.rand(1, sat) if self.rand() < .5 else 1 / self.rand(1, sat) val = self.rand(1, val) if self.rand() < .5 else 1 / self.rand(1, val) x = cv2.cvtColor(np.array(image,np.float32)/255, cv2.COLOR_RGB2HSV) x[..., 0] += hue*360 x[..., 0][x[..., 0]>1] -= 1 x[..., 0][x[..., 0]<0] += 1 x[..., 1] *= sat x[..., 2] *= val x[x[:,:, 0]>360, 0] = 360 x[:, :, 1:][x[:, :, 1:]>1] = 1 x[x<0] = 0 image = cv2.cvtColor(x, cv2.COLOR_HSV2RGB) # numpy array, 0 to 1
image = Image.fromarray((image * 255).astype(np.uint8)) # 将图片进行放置,分别对应四张分割图片的位置 dx = place_x[index] dy = place_y[index] new_image = Image.new('RGB', (w, h), (np.random.randint(0, 255), np.random.randint(0, 255), np.random.randint(0, 255))) new_image.paste(image, (dx, dy)) image_data = np.array(new_image)
index = index + 1 box_data = [] # 对box进行重新处理 if len(box) > 0: np.random.shuffle(box) box[:, [0, 2]] = box[:, [0, 2]] * nw / iw + dx box[:, [1, 3]] = box[:, [1, 3]] * nh / ih + dy box[:, 0:2][box[:, 0:2] < 0] = 0 box[:, 2][box[:, 2] > w] = w box[:, 3][box[:, 3] > h] = h box_w = box[:, 2] - box[:, 0] box_h = box[:, 3] - box[:, 1] box = box[np.logical_and(box_w > 1, box_h > 1)] box_data = np.zeros((len(box), 5)) box_data[:len(box)] = box
image_datas.append(image_data) box_datas.append(box_data)
# 将图片分割,放在一起 cutx = np.random.randint(int(w * min_offset_x), int(w * (1 - min_offset_x))) cuty = np.random.randint(int(h * min_offset_y), int(h * (1 - min_offset_y)))
new_image = np.zeros([h, w, 3]) new_image[:cuty, :cutx, :] = image_datas[0][:cuty, :cutx, :] new_image[cuty:, :cutx, :] = image_datas[1][cuty:, :cutx, :] new_image[cuty:, cutx:, :] = image_datas[2][cuty:, cutx:, :] new_image[:cuty, cutx:, :] = image_datas[3][:cuty, cutx:, :]
# 对框进行进一步的处理 new_boxes = np.array(merge_bboxes(box_datas, cutx, cuty))
return new_image, new_boxes
def __getitem__(self, index): lines = self.train_lines n = self.train_batches index = index % n if self.mosaic: if self.flag and (index + 4) < n: img, y = self.get_random_data_with_Mosaic(lines[index:index + 4], self.image_size[0:2]) else: img, y = self.get_random_data(lines[index], self.image_size[0:2], random=self.is_train) self.flag = bool(1-self.flag) else: img, y = self.get_random_data(lines[index], self.image_size[0:2], random=self.is_train)
if len(y) != 0: # 从坐标转换成0~1的百分比 boxes = np.array(y[:, :4], dtype=np.float32) boxes[:, 0] = boxes[:, 0] / self.image_size[1] boxes[:, 1] = boxes[:, 1] / self.image_size[0] boxes[:, 2] = boxes[:, 2] / self.image_size[1] boxes[:, 3] = boxes[:, 3] / self.image_size[0]
boxes = np.maximum(np.minimum(boxes, 1), 0) boxes[:, 2] = boxes[:, 2] - boxes[:, 0] boxes[:, 3] = boxes[:, 3] - boxes[:, 1]
boxes[:, 0] = boxes[:, 0] + boxes[:, 2] / 2 boxes[:, 1] = boxes[:, 1] + boxes[:, 3] / 2 y = np.concatenate([boxes, y[:, -1:]], axis=-1)
img = np.array(img, dtype=np.float32)
tmp_inp = np.transpose(img / 255.0, (2, 0, 1)) tmp_targets = np.array(y, dtype=np.float32) return tmp_inp, tmp_targets
# DataLoader中collate_fn使用def yolo_dataset_collate(batch): images = [] bboxes = [] for img, box in batch: images.append(img) bboxes.append(box) images = np.array(images) return images, bboxes
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380from __future__ import division
import mathimport osimport time
import numpy as npimport torchimport torch.nn as nnimport torch.nn.functional as Ffrom PIL import Image, ImageDraw, ImageFontfrom torch.autograd import Variablefrom torchvision.ops import nms
class DecodeBox(nn.Module): def __init__(self, anchors, num_classes, img_size): super(DecodeBox, self).__init__() #-----------------------------------------------------------# # 13x13的特征层对应的anchor是[142, 110], [192, 243], [459, 401] # 26x26的特征层对应的anchor是[36, 75], [76, 55], [72, 146] # 52x52的特征层对应的anchor是[12, 16], [19, 36], [40, 28] #-----------------------------------------------------------# self.anchors = anchors self.num_anchors = len(anchors) self.num_classes = num_classes self.bbox_attrs = 5 + num_classes self.img_size = img_size
def forward(self, input): #-----------------------------------------------# # 输入的input一共有三个,他们的shape分别是 # batch_size, 255, 13, 13 # batch_size, 255, 26, 26 # batch_size, 255, 52, 52 #-----------------------------------------------# batch_size = input.size(0) input_height = input.size(2) input_width = input.size(3)
#-----------------------------------------------# # 输入为416x416时 # stride_h = stride_w = 32、16、8 #-----------------------------------------------# stride_h = self.img_size[1] / input_height stride_w = self.img_size[0] / input_width #-------------------------------------------------# # 此时获得的scaled_anchors大小是相对于特征层的 #-------------------------------------------------# scaled_anchors = [(anchor_width / stride_w, anchor_height / stride_h) for anchor_width, anchor_height in self.anchors]
#-----------------------------------------------# # 输入的input一共有三个,他们的shape分别是 # batch_size, 3, 13, 13, 85 # batch_size, 3, 26, 26, 85 # batch_size, 3, 52, 52, 85 #-----------------------------------------------# prediction = input.view(batch_size, self.num_anchors, self.bbox_attrs, input_height, input_width).permute(0, 1, 3, 4, 2).contiguous()
# 先验框的中心位置的调整参数 x = torch.sigmoid(prediction[..., 0]) y = torch.sigmoid(prediction[..., 1]) # 先验框的宽高调整参数 w = prediction[..., 2] h = prediction[..., 3] # 获得置信度,是否有物体 conf = torch.sigmoid(prediction[..., 4]) # 种类置信度 pred_cls = torch.sigmoid(prediction[..., 5:])
FloatTensor = torch.cuda.FloatTensor if x.is_cuda else torch.FloatTensor LongTensor = torch.cuda.LongTensor if x.is_cuda else torch.LongTensor
#----------------------------------------------------------# # 生成网格,先验框中心,网格左上角 # batch_size,3,13,13 #----------------------------------------------------------# grid_x = torch.linspace(0, input_width - 1, input_width).repeat(input_height, 1).repeat( batch_size * self.num_anchors, 1, 1).view(x.shape).type(FloatTensor) grid_y = torch.linspace(0, input_height - 1, input_height).repeat(input_width, 1).t().repeat( batch_size * self.num_anchors, 1, 1).view(y.shape).type(FloatTensor)
#----------------------------------------------------------# # 按照网格格式生成先验框的宽高 # batch_size,3,13,13 #----------------------------------------------------------# anchor_w = FloatTensor(scaled_anchors).index_select(1, LongTensor([0])) anchor_h = FloatTensor(scaled_anchors).index_select(1, LongTensor([1])) anchor_w = anchor_w.repeat(batch_size, 1).repeat(1, 1, input_height * input_width).view(w.shape) anchor_h = anchor_h.repeat(batch_size, 1).repeat(1, 1, input_height * input_width).view(h.shape)
#----------------------------------------------------------# # 利用预测结果对先验框进行调整 # 首先调整先验框的中心,从先验框中心向右下角偏移 # 再调整先验框的宽高。 #----------------------------------------------------------# pred_boxes = FloatTensor(prediction[..., :4].shape) pred_boxes[..., 0] = x.data + grid_x pred_boxes[..., 1] = y.data + grid_y pred_boxes[..., 2] = torch.exp(w.data) * anchor_w pred_boxes[..., 3] = torch.exp(h.data) * anchor_h
# fig = plt.figure() # ax = fig.add_subplot(121) # if input_height==13: # plt.ylim(0,13) # plt.xlim(0,13) # elif input_height==26: # plt.ylim(0,26) # plt.xlim(0,26) # elif input_height==52: # plt.ylim(0,52) # plt.xlim(0,52) # plt.scatter(grid_x.cpu(),grid_y.cpu())
# anchor_left = grid_x - anchor_w/2 # anchor_top = grid_y - anchor_h/2
# rect1 = plt.Rectangle([anchor_left[0,0,5,5],anchor_top[0,0,5,5]],anchor_w[0,0,5,5],anchor_h[0,0,5,5],color="r",fill=False) # rect2 = plt.Rectangle([anchor_left[0,1,5,5],anchor_top[0,1,5,5]],anchor_w[0,1,5,5],anchor_h[0,1,5,5],color="r",fill=False) # rect3 = plt.Rectangle([anchor_left[0,2,5,5],anchor_top[0,2,5,5]],anchor_w[0,2,5,5],anchor_h[0,2,5,5],color="r",fill=False)
# ax.add_patch(rect1) # ax.add_patch(rect2) # ax.add_patch(rect3)
# ax = fig.add_subplot(122) # if input_height==13: # plt.ylim(0,13) # plt.xlim(0,13) # elif input_height==26: # plt.ylim(0,26) # plt.xlim(0,26) # elif input_height==52: # plt.ylim(0,52) # plt.xlim(0,52) # plt.scatter(grid_x.cpu(),grid_y.cpu()) # plt.scatter(pred_boxes[0,:,5,5,0].cpu(),pred_boxes[0,:,5,5,1].cpu(),c='r')
# pre_left = pred_boxes[...,0] - pred_boxes[...,2]/2 # pre_top = pred_boxes[...,1] - pred_boxes[...,3]/2
# rect1 = plt.Rectangle([pre_left[0,0,5,5],pre_top[0,0,5,5]],pred_boxes[0,0,5,5,2],pred_boxes[0,0,5,5,3],color="r",fill=False) # rect2 = plt.Rectangle([pre_left[0,1,5,5],pre_top[0,1,5,5]],pred_boxes[0,1,5,5,2],pred_boxes[0,1,5,5,3],color="r",fill=False) # rect3 = plt.Rectangle([pre_left[0,2,5,5],pre_top[0,2,5,5]],pred_boxes[0,2,5,5,2],pred_boxes[0,2,5,5,3],color="r",fill=False)
# ax.add_patch(rect1) # ax.add_patch(rect2) # ax.add_patch(rect3)
# plt.show()
#----------------------------------------------------------# # 将输出结果调整成相对于输入图像大小 #----------------------------------------------------------# _scale = torch.Tensor([stride_w, stride_h] * 2).type(FloatTensor) output = torch.cat((pred_boxes.view(batch_size, -1, 4) * _scale, conf.view(batch_size, -1, 1), pred_cls.view(batch_size, -1, self.num_classes)), -1) return output.data def letterbox_image(image, size): iw, ih = image.size w, h = size scale = min(w/iw, h/ih) nw = int(iw*scale) nh = int(ih*scale)
image = image.resize((nw,nh), Image.BICUBIC) new_image = Image.new('RGB', size, (128,128,128)) new_image.paste(image, ((w-nw)//2, (h-nh)//2)) return new_image
def yolo_correct_boxes(top, left, bottom, right, input_shape, image_shape): new_shape = image_shape*np.min(input_shape/image_shape)
offset = (input_shape-new_shape)/2./input_shape scale = input_shape/new_shape
box_yx = np.concatenate(((top+bottom)/2,(left+right)/2),axis=-1)/input_shape box_hw = np.concatenate((bottom-top,right-left),axis=-1)/input_shape
box_yx = (box_yx - offset) * scale box_hw *= scale
box_mins = box_yx - (box_hw / 2.) box_maxes = box_yx + (box_hw / 2.) boxes = np.concatenate([ box_mins[:, 0:1], box_mins[:, 1:2], box_maxes[:, 0:1], box_maxes[:, 1:2] ],axis=-1) boxes *= np.concatenate([image_shape, image_shape],axis=-1) return boxes
def bbox_iou(box1, box2, x1y1x2y2=True): """ 计算IOU """ if not x1y1x2y2: b1_x1, b1_x2 = box1[:, 0] - box1[:, 2] / 2, box1[:, 0] + box1[:, 2] / 2 b1_y1, b1_y2 = box1[:, 1] - box1[:, 3] / 2, box1[:, 1] + box1[:, 3] / 2 b2_x1, b2_x2 = box2[:, 0] - box2[:, 2] / 2, box2[:, 0] + box2[:, 2] / 2 b2_y1, b2_y2 = box2[:, 1] - box2[:, 3] / 2, box2[:, 1] + box2[:, 3] / 2 else: b1_x1, b1_y1, b1_x2, b1_y2 = box1[:, 0], box1[:, 1], box1[:, 2], box1[:, 3] b2_x1, b2_y1, b2_x2, b2_y2 = box2[:, 0], box2[:, 1], box2[:, 2], box2[:, 3]
inter_rect_x1 = torch.max(b1_x1, b2_x1) inter_rect_y1 = torch.max(b1_y1, b2_y1) inter_rect_x2 = torch.min(b1_x2, b2_x2) inter_rect_y2 = torch.min(b1_y2, b2_y2)
inter_area = torch.clamp(inter_rect_x2 - inter_rect_x1 + 1, min=0) * \ torch.clamp(inter_rect_y2 - inter_rect_y1 + 1, min=0) b1_area = (b1_x2 - b1_x1 + 1) * (b1_y2 - b1_y1 + 1) b2_area = (b2_x2 - b2_x1 + 1) * (b2_y2 - b2_y1 + 1)
iou = inter_area / (b1_area + b2_area - inter_area + 1e-16)
return iou
def non_max_suppression(prediction, num_classes, conf_thres=0.5, nms_thres=0.4): #----------------------------------------------------------# # 将预测结果的格式转换成左上角右下角的格式。 # prediction [batch_size, num_anchors, 85] #----------------------------------------------------------# box_corner = prediction.new(prediction.shape) box_corner[:, :, 0] = prediction[:, :, 0] - prediction[:, :, 2] / 2 box_corner[:, :, 1] = prediction[:, :, 1] - prediction[:, :, 3] / 2 box_corner[:, :, 2] = prediction[:, :, 0] + prediction[:, :, 2] / 2 box_corner[:, :, 3] = prediction[:, :, 1] + prediction[:, :, 3] / 2 prediction[:, :, :4] = box_corner[:, :, :4]
output = [None for _ in range(len(prediction))] for image_i, image_pred in enumerate(prediction): #----------------------------------------------------------# # 对种类预测部分取max。 # class_conf [num_anchors, 1] 种类置信度 # class_pred [num_anchors, 1] 种类 #----------------------------------------------------------# class_conf, class_pred = torch.max(image_pred[:, 5:5 + num_classes], 1, keepdim=True)
#----------------------------------------------------------# # 利用置信度进行第一轮筛选 #----------------------------------------------------------# conf_mask = (image_pred[:, 4] * class_conf[:, 0] >= conf_thres).squeeze()
#----------------------------------------------------------# # 根据置信度进行预测结果的筛选 #----------------------------------------------------------# image_pred = image_pred[conf_mask] class_conf = class_conf[conf_mask] class_pred = class_pred[conf_mask] if not image_pred.size(0): continue #-------------------------------------------------------------------------# # detections [num_anchors, 7] # 7的内容为:x1, y1, x2, y2, obj_conf, class_conf, class_pred #-------------------------------------------------------------------------# detections = torch.cat((image_pred[:, :5], class_conf.float(), class_pred.float()), 1)
#------------------------------------------# # 获得预测结果中包含的所有种类 #------------------------------------------# unique_labels = detections[:, -1].cpu().unique()
if prediction.is_cuda: unique_labels = unique_labels.cuda() detections = detections.cuda()
for c in unique_labels: #------------------------------------------# # 获得某一类得分筛选后全部的预测结果 #------------------------------------------# detections_class = detections[detections[:, -1] == c]
#------------------------------------------# # 使用官方自带的非极大抑制会速度更快一些! #------------------------------------------# keep = nms( detections_class[:, :4], detections_class[:, 4] * detections_class[:, 5], nms_thres ) max_detections = detections_class[keep] # # 按照存在物体的置信度排序 # _, conf_sort_index = torch.sort(detections_class[:, 4]*detections_class[:, 5], descending=True) # detections_class = detections_class[conf_sort_index] # # 进行非极大抑制 # max_detections = [] # while detections_class.size(0): # # 取出这一类置信度最高的,一步一步往下判断,判断重合程度是否大于nms_thres,如果是则去除掉 # max_detections.append(detections_class[0].unsqueeze(0)) # if len(detections_class) == 1: # break # ious = bbox_iou(max_detections[-1], detections_class[1:]) # detections_class = detections_class[1:][ious < nms_thres] # # 堆叠 # max_detections = torch.cat(max_detections).data # Add max detections to outputs output[image_i] = max_detections if output[image_i] is None else torch.cat( (output[image_i], max_detections))
return output
def merge_bboxes(bboxes, cutx, cuty): merge_bbox = [] for i in range(len(bboxes)): for box in bboxes[i]: tmp_box = [] x1,y1,x2,y2 = box[0], box[1], box[2], box[3]
if i == 0: if y1 > cuty or x1 > cutx: continue if y2 >= cuty and y1 <= cuty: y2 = cuty if y2-y1 < 5: continue if x2 >= cutx and x1 <= cutx: x2 = cutx if x2-x1 < 5: continue if i == 1: if y2 < cuty or x1 > cutx: continue
if y2 >= cuty and y1 <= cuty: y1 = cuty if y2-y1 < 5: continue if x2 >= cutx and x1 <= cutx: x2 = cutx if x2-x1 < 5: continue
if i == 2: if y2 < cuty or x2 < cutx: continue
if y2 >= cuty and y1 <= cuty: y1 = cuty if y2-y1 < 5: continue
if x2 >= cutx and x1 <= cutx: x1 = cutx if x2-x1 < 5: continue
if i == 3: if y1 > cuty or x2 < cutx: continue
if y2 >= cuty and y1 <= cuty: y2 = cuty if y2-y1 < 5: continue
if x2 >= cutx and x1 <= cutx: x1 = cutx if x2-x1 < 5: continue
tmp_box.append(x1) tmp_box.append(y1) tmp_box.append(x2) tmp_box.append(y2) tmp_box.append(box[-1]) merge_bbox.append(tmp_box) return merge_bbox1234567891011121314151617181920212223242526272829303132333435363738394041424344#-------------------------------------## 调用摄像头或者视频进行检测# 调用摄像头直接运行即可# 调用视频可以将cv2.VideoCapture()指定路径# 视频的保存并不难,可以百度一下看看#-------------------------------------#import time
import cv2import numpy as npfrom PIL import Image
from yolo import YOLO
yolo = YOLO()#-------------------------------------## 调用摄像头# capture=cv2.VideoCapture("1.mp4")#-------------------------------------#capture=cv2.VideoCapture(0)fps = 0.0while(True): t1 = time.time() # 读取某一帧 ref,frame=capture.read() # 格式转变,BGRtoRGB frame = cv2.cvtColor(frame,cv2.COLOR_BGR2RGB) # 转变成Image frame = Image.fromarray(np.uint8(frame)) # 进行检测 frame = np.array(yolo.detect_image(frame)) # RGBtoBGR满足opencv显示格式 frame = cv2.cvtColor(frame,cv2.COLOR_RGB2BGR)
fps = ( fps + (1./(time.time()-t1)) ) / 2 print("fps= %.2f"%(fps)) frame = cv2.putText(frame, "fps= %.2f"%(fps), (0, 40), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)
cv2.imshow("video",frame)
c= cv2.waitKey(1) & 0xff if c==27: capture.release() break12345678910111213141516171819202122232425262728293031323334353637383940#---------------------------------------------## 运行前一定要修改classes# 如果生成的2007_train.txt里面没有目标信息# 那么就是因为classes没有设定正确#---------------------------------------------#import xml.etree.ElementTree as ETfrom os import getcwd
sets=[('2007', 'train'), ('2007', 'val'), ('2007', 'test')]
classes = ["cruiseship", "ferryboat", "freightboat", "gondola", "inflatableboat", "kayak", "paperboat", "sailboat", "buoy"]
def convert_annotation(year, image_id, list_file): in_file = open('VOCdevkit/VOC%s/Annotations/%s.xml'%(year, image_id), encoding='utf-8') tree=ET.parse(in_file) root = tree.getroot()
for obj in root.iter('object'): difficult = 0 if obj.find('difficult')!=None: difficult = obj.find('difficult').text cls = obj.find('name').text if cls not in classes or int(difficult)==1: continue cls_id = classes.index(cls) xmlbox = obj.find('bndbox') b = (int(xmlbox.find('xmin').text), int(xmlbox.find('ymin').text), int(xmlbox.find('xmax').text), int(xmlbox.find('ymax').text)) list_file.write(" " + ",".join([str(a) for a in b]) + ',' + str(cls_id))
wd = getcwd()
for year, image_set in sets: image_ids = open('VOCdevkit/VOC%s/ImageSets/Main/%s.txt'%(year, image_set)).read().strip().split() list_file = open('%s_%s.txt'%(year, image_set), 'w') for image_id in image_ids: list_file.write('%s/VOCdevkit/VOC%s/JPEGImages/%s.jpg'%(wd, year, image_id)) convert_annotation(year, image_id, list_file) list_file.write('\n') list_file.close().gitattributes+4
3_基于视觉的无人艇感知技术/.gitkeepAdded
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/.gitkeepAdded
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/.idea/.gitignoreAdded
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/.idea/inspectionProfiles/profiles_settings.xmlAdded+6
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/.idea/misc.xmlAdded+7
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/.idea/modules.xmlAdded+8
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/.idea/workspace.xmlAdded+204
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/.idea/yolov4_pytorch_down_1fpn.imlAdded+12
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/2007_test.txtAdded+278
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/2007_train.txtAdded
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/2007_val.txtAdded
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/FPS_test.pyAdded+119
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/LICENSEAdded+21
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/README.mdAdded+137
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/VOCdevkit/VOC2007/ImageSets/Main/README.mdAdded+1
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/VOCdevkit/VOC2007/ImageSets/Main/test.txtAdded+278
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/VOCdevkit/VOC2007/ImageSets/Main/train.txtAdded+1178
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/VOCdevkit/VOC2007/ImageSets/Main/trainval.txtAdded
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/VOCdevkit/VOC2007/ImageSets/Main/val.txtAdded
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/VOCdevkit/VOC2007/voc2yolo4.pyAdded+61
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/__pycache__/yolo.cpython-36.pycAdded
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/get_dr_txt.pyAdded+144
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/get_gt_txt.pyAdded+63
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/get_map.pyAdded+901
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/get_sizemap.pyAdded+407
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/img/street.jpgAdded

Large File Pointer Details
- SHA256: f6bb0112f86a8de40c799a2b3a308a70d2eece52209018490028dd162b4c772c
- Pointer size: 131 Bytes
- Size of remote file: 448 kB
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/kmeans_for_anchors.pyAdded+111
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/model_data/coco_classes.txtAdded+80
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/model_data/voc_classes.txtAdded+9
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/model_data/yolo_anchors.txtAdded+1
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/nets/CSPdarknet.pyAdded+179
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/nets/__pycache__/CSPdarknet.cpython-36.pycAdded
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/nets/__pycache__/layers.cpython-36.pycAdded
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/nets/__pycache__/yolo4.cpython-36.pycAdded
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/nets/__pycache__/yolo_training.cpython-36.pycAdded
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/nets/layers.pyAdded+369
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/nets/yolo4.pyAdded+609
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/nets/yolo_training.pyAdded+690
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/note.txtAdded+2
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/predict.pyAdded+27
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/test.pyAdded+16
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/train.pyAdded+315
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/train_with_tensorboard.pyAdded+334
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/utils/__pycache__/dataloader.cpython-36.pycAdded
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/utils/__pycache__/utils.cpython-36.pycAdded
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/utils/dataloader.pyAdded+272
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/utils/utils.pyAdded+380
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/video.pyAdded+44
3_基于视觉的无人艇感知技术/3_1_水面高光照场景下的目标检测/CRB-Net/voc_annotation.pyAdded+40