Bläddra i källkod

Add download data for tests

Bobholamovic 2 år sedan
förälder
incheckning
4347aef4b2
47 ändrade filer med 28 tillägg och 198 borttagningar
  1. 2 1
      tests/check_coverage.sh
  2. 2 0
      tests/data/.gitignore
  3. BIN
      tests/data/ssmt/binary_gt.bmp
  4. BIN
      tests/data/ssmt/multiclass_gt.png
  5. BIN
      tests/data/ssmt/multiclass_gt2.png
  6. BIN
      tests/data/ssmt/multispectral_t1.tif
  7. BIN
      tests/data/ssmt/multispectral_t2.tif
  8. BIN
      tests/data/ssmt/optical_t1.bmp
  9. BIN
      tests/data/ssmt/optical_t2.bmp
  10. BIN
      tests/data/ssmt/sar_t1.tiff
  11. BIN
      tests/data/ssmt/sar_t2.tiff
  12. 0 3
      tests/data/ssmt/test_mixed_binary.txt
  13. 0 6
      tests/data/ssmt/test_mixed_multiclass.txt
  14. 0 3
      tests/data/ssmt/test_mixed_multitask.txt
  15. 0 1
      tests/data/ssmt/test_multispectral_binary.txt
  16. 0 2
      tests/data/ssmt/test_multispectral_multiclass.txt
  17. 0 1
      tests/data/ssmt/test_multispectral_multitask.txt
  18. 0 1
      tests/data/ssmt/test_optical_binary.txt
  19. 0 2
      tests/data/ssmt/test_optical_multiclass.txt
  20. 0 1
      tests/data/ssmt/test_optical_multitask.txt
  21. 0 1
      tests/data/ssmt/test_sar_binary.txt
  22. 0 2
      tests/data/ssmt/test_sar_multiclass.txt
  23. 0 1
      tests/data/ssmt/test_sar_multitask.txt
  24. 0 106
      tests/data/ssst/det_gt_coco.json
  25. 0 37
      tests/data/ssst/det_gt_voc.xml
  26. 0 3
      tests/data/ssst/labels_det.txt
  27. BIN
      tests/data/ssst/multiclass_gt.png
  28. BIN
      tests/data/ssst/multiclass_gt2.png
  29. BIN
      tests/data/ssst/multispectral.tif
  30. BIN
      tests/data/ssst/optical.bmp
  31. BIN
      tests/data/ssst/sar.tiff
  32. 0 1
      tests/data/ssst/test_det_coco.txt
  33. 0 3
      tests/data/ssst/test_mixed_clas.txt
  34. 0 3
      tests/data/ssst/test_mixed_det.txt
  35. 0 6
      tests/data/ssst/test_mixed_seg.txt
  36. 0 1
      tests/data/ssst/test_multispectral_clas.txt
  37. 0 1
      tests/data/ssst/test_multispectral_det.txt
  38. 0 2
      tests/data/ssst/test_multispectral_seg.txt
  39. 0 1
      tests/data/ssst/test_optical_clas.txt
  40. 0 1
      tests/data/ssst/test_optical_det.txt
  41. 0 2
      tests/data/ssst/test_optical_seg.txt
  42. 0 1
      tests/data/ssst/test_sar_clas.txt
  43. 0 1
      tests/data/ssst/test_sar_det.txt
  44. 0 2
      tests/data/ssst/test_sar_seg.txt
  45. 20 0
      tests/download_test_data.sh
  46. 2 1
      tests/run_fast_tests.sh
  47. 2 1
      tests/run_tests.sh

+ 2 - 1
tests/check_coverage.sh

@@ -1,5 +1,6 @@
-#!/usr/bin/bash
+#!/usr/bin/env bash
 
+bash download_test_data
 coverage run --source paddlers,$(ls -d ../tools/* | tr '\n' ',') --omit=../paddlers/models/* -m unittest discover -v
 coverage report
 coverage html -d coverage_html

+ 2 - 0
tests/data/.gitignore

@@ -0,0 +1,2 @@
+*.tar.gz
+*/

BIN
tests/data/ssmt/binary_gt.bmp


BIN
tests/data/ssmt/multiclass_gt.png


BIN
tests/data/ssmt/multiclass_gt2.png


BIN
tests/data/ssmt/multispectral_t1.tif


BIN
tests/data/ssmt/multispectral_t2.tif


BIN
tests/data/ssmt/optical_t1.bmp


BIN
tests/data/ssmt/optical_t2.bmp


BIN
tests/data/ssmt/sar_t1.tiff


BIN
tests/data/ssmt/sar_t2.tiff


+ 0 - 3
tests/data/ssmt/test_mixed_binary.txt

@@ -1,3 +0,0 @@
-optical_t1.bmp optical_t2.bmp binary_gt.bmp
-sar_t1.tiff sar_t2.tiff binary_gt.bmp
-multispectral_t1.tif multispectral_t2.tif binary_gt.bmp

+ 0 - 6
tests/data/ssmt/test_mixed_multiclass.txt

@@ -1,6 +0,0 @@
-optical_t1.bmp optical_t2.bmp multiclass_gt.png
-sar_t1.tiff sar_t2.tiff multiclass_gt.png
-multispectral_t1.tif multispectral_t2.tif multiclass_gt.png
-optical_t1.bmp optical_t2.bmp multiclass_gt2.png
-sar_t1.tiff sar_t2.tiff multiclass_gt2.png
-multispectral_t1.tif multispectral_t2.tif multiclass_gt2.png

+ 0 - 3
tests/data/ssmt/test_mixed_multitask.txt

@@ -1,3 +0,0 @@
-optical_t1.bmp optical_t2.bmp binary_gt.bmp binary_gt.bmp binary_gt.bmp
-sar_t1.tiff sar_t2.tiff binary_gt.bmp binary_gt.bmp binary_gt.bmp
-multispectral_t1.tif multispectral_t2.tif binary_gt.bmp binary_gt.bmp binary_gt.bmp

+ 0 - 1
tests/data/ssmt/test_multispectral_binary.txt

@@ -1 +0,0 @@
-multispectral_t1.tif multispectral_t2.tif binary_gt.bmp

+ 0 - 2
tests/data/ssmt/test_multispectral_multiclass.txt

@@ -1,2 +0,0 @@
-multispectral_t1.tif multispectral_t2.tif multiclass_gt.png
-multispectral_t1.tif multispectral_t2.tif multiclass_gt2.png

+ 0 - 1
tests/data/ssmt/test_multispectral_multitask.txt

@@ -1 +0,0 @@
-multispectral_t1.tif multispectral_t2.tif binary_gt.bmp binary_gt.bmp binary_gt.bmp

+ 0 - 1
tests/data/ssmt/test_optical_binary.txt

@@ -1 +0,0 @@
-optical_t1.bmp optical_t2.bmp binary_gt.bmp

+ 0 - 2
tests/data/ssmt/test_optical_multiclass.txt

@@ -1,2 +0,0 @@
-optical_t1.bmp optical_t2.bmp multiclass_gt.png
-optical_t1.bmp optical_t2.bmp multiclass_gt2.png

+ 0 - 1
tests/data/ssmt/test_optical_multitask.txt

@@ -1 +0,0 @@
-optical_t1.bmp optical_t2.bmp binary_gt.bmp binary_gt.bmp binary_gt.bmp

+ 0 - 1
tests/data/ssmt/test_sar_binary.txt

@@ -1 +0,0 @@
-sar_t1.tiff sar_t2.tiff binary_gt.bmp

+ 0 - 2
tests/data/ssmt/test_sar_multiclass.txt

@@ -1,2 +0,0 @@
-sar_t1.tiff sar_t2.tiff multiclass_gt.png
-sar_t1.tiff sar_t2.tiff multiclass_gt2.png

+ 0 - 1
tests/data/ssmt/test_sar_multitask.txt

@@ -1 +0,0 @@
-sar_t1.tiff sar_t2.tiff binary_gt.bmp binary_gt.bmp binary_gt.bmp

+ 0 - 106
tests/data/ssst/det_gt_coco.json

@@ -1,106 +0,0 @@
-{
-    "images": [
-        {
-            "height": 256,
-            "width": 256,
-            "id": 1,
-            "file_name": "optical.bmp"
-        },  
-        {
-            "height": 256,
-            "width": 256,
-            "id": 2,
-            "file_name": "sar.tiff"
-        },  
-        {
-            "height": 256,
-            "width": 256,
-            "id": 3,
-            "file_name": "multispectral.tif"
-        }
-    ],
-    "categories": [
-        {
-            "supercategory": "component",
-            "id": 1,
-            "name": "target"
-        }
-    ],
-    "annotations": [
-        {
-            "segmentation": [
-                [
-                    28,
-                    89,
-                    28,
-                    253,
-                    72,
-                    253,
-                    72,
-                    89
-                ]
-            ],
-            "iscrowd": 0,
-            "image_id": 1,
-            "bbox": [
-                28.0,
-                89.0,
-                44.0,
-                164.0
-            ],
-            "area": 7216.0,
-            "category_id": 1,
-            "id": 1
-        },
-        {
-            "segmentation": [
-                [
-                    28,
-                    89,
-                    28,
-                    253,
-                    72,
-                    253,
-                    72,
-                    89
-                ]
-            ],
-            "iscrowd": 0,
-            "image_id": 2,
-            "bbox": [
-                28.0,
-                89.0,
-                44.0,
-                164.0
-            ],
-            "area": 7216.0,
-            "category_id": 1,
-            "id": 2
-        },
-        {
-            "segmentation": [
-                [
-                    28,
-                    89,
-                    28,
-                    253,
-                    72,
-                    253,
-                    72,
-                    89
-                ]
-            ],
-            "iscrowd": 0,
-            "image_id": 3,
-            "bbox": [
-                28.0,
-                89.0,
-                44.0,
-                164.0
-            ],
-            "area": 7216.0,
-            "category_id": 1,
-            "id": 3
-        }
-    ]
-}

+ 0 - 37
tests/data/ssst/det_gt_voc.xml

@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<annotation>
-<filename>optical.bmp</filename>
-<size>
-<width>256</width>
-<height>256</height>
-</size>
-<resolution>3</resolution>
-<sensor>GF-3</sensor>
-<object>
-<name>ship</name>
-<bndbox>
-<xmin>0</xmin>
-<ymin>0</ymin>
-<xmax>125</xmax>
-<ymax>98</ymax>
-</bndbox>
-</object>
-<object>
-<name>plane</name>
-<bndbox>
-<xmin>10</xmin>
-<ymin>5</ymin>
-<xmax>67</xmax>
-<ymax>233</ymax>
-</bndbox>
-</object>
-<object>
-<name>submarine</name>
-<bndbox>
-<xmin>50</xmin>
-<ymin>228</ymin>
-<xmax>60</xmax>
-<ymax>240</ymax>
-</bndbox>
-</object>
-</annotation>

+ 0 - 3
tests/data/ssst/labels_det.txt

@@ -1,3 +0,0 @@
-ship
-plane
-submarine

BIN
tests/data/ssst/multiclass_gt.png


BIN
tests/data/ssst/multiclass_gt2.png


BIN
tests/data/ssst/multispectral.tif


BIN
tests/data/ssst/optical.bmp


BIN
tests/data/ssst/sar.tiff


+ 0 - 1
tests/data/ssst/test_det_coco.txt

@@ -1 +0,0 @@
-./ det_gt_coco.json

+ 0 - 3
tests/data/ssst/test_mixed_clas.txt

@@ -1,3 +0,0 @@
-optical.bmp 0
-sar.tiff 1
-multispectral.tif 2

+ 0 - 3
tests/data/ssst/test_mixed_det.txt

@@ -1,3 +0,0 @@
-optical.bmp det_gt_voc.xml
-sar.tiff det_gt_voc.xml
-multispectral.tif det_gt_voc.xml

+ 0 - 6
tests/data/ssst/test_mixed_seg.txt

@@ -1,6 +0,0 @@
-optical.bmp multiclass_gt.png
-sar.tiff multiclass_gt.png
-multispectral.tif multiclass_gt.png
-optical.bmp multiclass_gt2.png
-sar.tiff multiclass_gt2.png
-multispectral.tif multiclass_gt2.png

+ 0 - 1
tests/data/ssst/test_multispectral_clas.txt

@@ -1 +0,0 @@
-multispectral.tif 2

+ 0 - 1
tests/data/ssst/test_multispectral_det.txt

@@ -1 +0,0 @@
-multispectral.tif det_gt_voc.xml

+ 0 - 2
tests/data/ssst/test_multispectral_seg.txt

@@ -1,2 +0,0 @@
-multispectral.tif multiclass_gt.png
-multispectral.tif multiclass_gt2.png

+ 0 - 1
tests/data/ssst/test_optical_clas.txt

@@ -1 +0,0 @@
-optical.bmp 0

+ 0 - 1
tests/data/ssst/test_optical_det.txt

@@ -1 +0,0 @@
-optical.bmp det_gt_voc.xml

+ 0 - 2
tests/data/ssst/test_optical_seg.txt

@@ -1,2 +0,0 @@
-optical.bmp multiclass_gt.png
-optical.bmp multiclass_gt2.png

+ 0 - 1
tests/data/ssst/test_sar_clas.txt

@@ -1 +0,0 @@
-sar.tiff 1

+ 0 - 1
tests/data/ssst/test_sar_det.txt

@@ -1 +0,0 @@
-sar.tiff det_gt_voc.xml

+ 0 - 2
tests/data/ssst/test_sar_seg.txt

@@ -1,2 +0,0 @@
-sar.tiff multiclass_gt.png
-sar.tiff multiclass_gt2.png

+ 20 - 0
tests/download_test_data.sh

@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+function remove_dir_if_exist() {
+    local dir="$1"
+    if [ -d "${dir}" ]; then
+        rm -rf "${dir}"
+        echo "\033[0;31mDirectory ${dir} has been removed.\033[0m"
+    fi
+}
+
+## Remove old directories (if they exist)
+remove_dir_if_exist 'data/ssst'
+remove_dir_if_exist 'data/ssmt'
+
+## Download and unzip
+wget -nc -P data/ https://paddlers.bj.bcebos.com/tests/data/ssst.tar.gz --no-check-certificate
+tar -zxf data/ssst.tar.gz -C data/
+
+wget -nc -P data/ https://paddlers.bj.bcebos.com/tests/data/ssmt.tar.gz --no-check-certificate
+tar -zxf data/ssmt.tar.gz -C data/

+ 2 - 1
tests/run_fast_tests.sh

@@ -1,3 +1,4 @@
-#!/usr/bin/bash
+#!/usr/bin/env bash
 
+bash download_test_data
 python -m unittest -v fast_tests

+ 2 - 1
tests/run_tests.sh

@@ -1,3 +1,4 @@
-#!/usr/bin/bash
+#!/usr/bin/env bash
 
+bash download_test_data
 python -m unittest discover -v