From 81437c67651b583d02943c1d1970946fb05117bb Mon Sep 17 00:00:00 2001 From: Han Wu Date: Sat, 19 Aug 2023 13:37:32 +0100 Subject: [PATCH 01/14] Update faster_rcnn_demo.py --- examples/inference/faster_rcnn_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/inference/faster_rcnn_demo.py b/examples/inference/faster_rcnn_demo.py index b99e457..c92a360 100644 --- a/examples/inference/faster_rcnn_demo.py +++ b/examples/inference/faster_rcnn_demo.py @@ -38,7 +38,7 @@ device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") model = FasterRCNN(device=device) -model.load(os.path.join(WHAT_MODEL_PATH, what_model_list[8][WHAT_MODEL_FILE_INDEX]), map_location=device) +model.load(os.path.join(WHAT_MODEL_PATH, WHAT_MODEL_FILE), map_location=device) while True: _, orig_image = cap.read() From 4f924624fe454ebd49fc5cdf9345eee9feac46d1 Mon Sep 17 00:00:00 2001 From: Han Wu Date: Sat, 19 Aug 2023 13:52:18 +0100 Subject: [PATCH 02/14] Update mobilenet_v1_ssd_demo.py --- examples/inference/mobilenet_v1_ssd_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/inference/mobilenet_v1_ssd_demo.py b/examples/inference/mobilenet_v1_ssd_demo.py index 425cb9c..7539c5f 100644 --- a/examples/inference/mobilenet_v1_ssd_demo.py +++ b/examples/inference/mobilenet_v1_ssd_demo.py @@ -35,7 +35,7 @@ WHAT_MODEL_HASH) # Initialize the model -model = MobileNetV1SSD(os.path.join(WHAT_MODEL_PATH, what_model_list[index][WHAT_MODEL_FILE_INDEX]), +model = MobileNetV1SSD(os.path.join(WHAT_MODEL_PATH, WHAT_MODEL_FILE), VOC_CLASS_NAMES, is_test=True, device=device) From e0de4f29b8b38c9d2925b6cd14ed8337b44a2244 Mon Sep 17 00:00:00 2001 From: Han Wu Date: Sat, 19 Aug 2023 13:52:38 +0100 Subject: [PATCH 03/14] Update mobilenet_v2_ssd_lite_demo.py --- examples/inference/mobilenet_v2_ssd_lite_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/inference/mobilenet_v2_ssd_lite_demo.py b/examples/inference/mobilenet_v2_ssd_lite_demo.py index 31a7284..2affa2c 100644 --- a/examples/inference/mobilenet_v2_ssd_lite_demo.py +++ b/examples/inference/mobilenet_v2_ssd_lite_demo.py @@ -35,7 +35,7 @@ WHAT_MODEL_HASH) # Initialize the model -model = MobileNetV2SSDLite(os.path.join(WHAT_MODEL_PATH, what_model_list[index][WHAT_MODEL_FILE_INDEX]), +model = MobileNetV2SSDLite(os.path.join(WHAT_MODEL_PATH, WHAT_MODEL_FILE), VOC_CLASS_NAMES, is_test=True, device=device) From 49d428c3eab779daf0e62147bcb362060a12b790 Mon Sep 17 00:00:00 2001 From: Han Wu Date: Sat, 19 Aug 2023 13:53:07 +0100 Subject: [PATCH 04/14] Update yolov3_demo.py --- examples/inference/yolov3_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/inference/yolov3_demo.py b/examples/inference/yolov3_demo.py index 52f986d..644def9 100644 --- a/examples/inference/yolov3_demo.py +++ b/examples/inference/yolov3_demo.py @@ -34,7 +34,7 @@ WHAT_YOLOV3_MODEL_HASH) # MobileNet -model = YOLOV3(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, what_yolov3_model_list[index][WHAT_MODEL_FILE_INDEX])) +model = YOLOV3(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, WHAT_YOLOV3_MODEL_FILE)) # You can also use your own model # model = YOLOV3(COCO_CLASS_NAMES, "models/yolov3.h5") From 1ab61c194f4e491d88ccd2abdba41260e7891a6b Mon Sep 17 00:00:00 2001 From: Han Wu Date: Sat, 19 Aug 2023 13:53:30 +0100 Subject: [PATCH 05/14] Update yolov3_tiny_demo.py --- examples/inference/yolov3_tiny_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/inference/yolov3_tiny_demo.py b/examples/inference/yolov3_tiny_demo.py index 5278a8a..5bd0aff 100644 --- a/examples/inference/yolov3_tiny_demo.py +++ b/examples/inference/yolov3_tiny_demo.py @@ -34,7 +34,7 @@ WHAT_YOLOV3_MODEL_HASH) # Check what_model_list for all supported models -model = YOLOV3_TINY(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, what_yolov3_model_list[index][WHAT_MODEL_FILE_INDEX])) +model = YOLOV3_TINY(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, WHAT_YOLOV3_MODEL_FILE)) # You can also use your own model # model = YOLOV3_TINY(COCO_CLASS_NAMES, "models/yolov3-tiny.h5") From bb0b6c90c95f4d52a194c9802d779173bda3c0ec Mon Sep 17 00:00:00 2001 From: Han Wu Date: Sat, 19 Aug 2023 13:53:53 +0100 Subject: [PATCH 06/14] Update yolov4_demo.py --- examples/inference/yolov4_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/inference/yolov4_demo.py b/examples/inference/yolov4_demo.py index 96e06ab..d61cbb3 100644 --- a/examples/inference/yolov4_demo.py +++ b/examples/inference/yolov4_demo.py @@ -34,7 +34,7 @@ WHAT_YOLOV4_MODEL_HASH) # Darknet -model = YOLOV4(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, what_yolov4_model_list[index][WHAT_MODEL_FILE_INDEX])) +model = YOLOV4(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, WHAT_YOLOV4_MODEL_FILE)) # You can also use your own model # model = YOLOV4(COCO_CLASS_NAMES, "models/yolov4.h5") From f50d1ddea788ffffb356918b8126c11673fb9027 Mon Sep 17 00:00:00 2001 From: Han Wu Date: Sat, 19 Aug 2023 13:54:09 +0100 Subject: [PATCH 07/14] Update yolov4_tiny_demo.py --- examples/inference/yolov4_tiny_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/inference/yolov4_tiny_demo.py b/examples/inference/yolov4_tiny_demo.py index fd65b4f..149ebe0 100644 --- a/examples/inference/yolov4_tiny_demo.py +++ b/examples/inference/yolov4_tiny_demo.py @@ -34,7 +34,7 @@ WHAT_YOLOV4_MODEL_HASH) # Darknet -model = YOLOV4_TINY(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, what_yolov4_model_list[index][WHAT_MODEL_FILE_INDEX])) +model = YOLOV4_TINY(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, WHAT_YOLOV4_MODEL_FILE)) # You can also use your own model # model = YOLOV4_TINY(COCO_CLASS_NAMES, "models/yolov4-tiny.h5") From 453efba63065114fe54a959bfa88dc4cf210b583 Mon Sep 17 00:00:00 2001 From: Han Wu Date: Sat, 19 Aug 2023 13:56:10 +0100 Subject: [PATCH 08/14] Update yolov4_demo.py --- what/examples/yolov4_demo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/what/examples/yolov4_demo.py b/what/examples/yolov4_demo.py index f53ad13..302d71b 100644 --- a/what/examples/yolov4_demo.py +++ b/what/examples/yolov4_demo.py @@ -41,10 +41,10 @@ def yolov4_inference_demo(): WHAT_YOLOV4_MODEL_HASH) if index == 0: - model = YOLOV4(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, what_yolov4_model_list[index][WHAT_MODEL_FILE_INDEX])) + model = YOLOV4(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, WHAT_YOLOV4_MODEL_FILE])) if index == 1: - model = YOLOV4_TINY(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, what_yolov4_model_list[index][WHAT_MODEL_FILE_INDEX])) + model = YOLOV4_TINY(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, WHAT_YOLOV4_MODEL_FILE])) video = input(f"Please input the OpenCV capture device (e.g. 0, 1, 2): ") From 241da4b44eaa909e43efe20e254b8d42ebc3fddb Mon Sep 17 00:00:00 2001 From: Han Wu Date: Sat, 19 Aug 2023 13:56:58 +0100 Subject: [PATCH 09/14] Update yolov3_demo.py --- what/examples/yolov3_demo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/what/examples/yolov3_demo.py b/what/examples/yolov3_demo.py index 0faf60d..d878342 100644 --- a/what/examples/yolov3_demo.py +++ b/what/examples/yolov3_demo.py @@ -41,10 +41,10 @@ def yolov3_inference_demo(): WHAT_YOLOV3_MODEL_HASH) if index == 0 or index == 1: - model = YOLOV3(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, what_yolov3_model_list[index][WHAT_MODEL_FILE_INDEX])) + model = YOLOV3(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, WHAT_YOLOV3_MODEL_FILE)) if index == 2 or index == 3: - model = YOLOV3_TINY(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, what_yolov3_model_list[index][WHAT_MODEL_FILE_INDEX])) + model = YOLOV3_TINY(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, WHAT_YOLOV3_MODEL_FILE)) video = input(f"Please input the OpenCV capture device (e.g. 0, 1, 2): ") From 07757a88b0a718b2e242e5cd81dbca553df32bbe Mon Sep 17 00:00:00 2001 From: wuhanstudio Date: Sat, 19 Aug 2023 15:39:54 +0100 Subject: [PATCH 10/14] [fix] grammar error --- what/examples/yolov4_demo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/what/examples/yolov4_demo.py b/what/examples/yolov4_demo.py index 302d71b..20ba4d1 100644 --- a/what/examples/yolov4_demo.py +++ b/what/examples/yolov4_demo.py @@ -41,10 +41,10 @@ def yolov4_inference_demo(): WHAT_YOLOV4_MODEL_HASH) if index == 0: - model = YOLOV4(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, WHAT_YOLOV4_MODEL_FILE])) + model = YOLOV4(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, WHAT_YOLOV4_MODEL_FILE)) if index == 1: - model = YOLOV4_TINY(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, WHAT_YOLOV4_MODEL_FILE])) + model = YOLOV4_TINY(COCO_CLASS_NAMES, os.path.join(WHAT_MODEL_PATH, WHAT_YOLOV4_MODEL_FILE)) video = input(f"Please input the OpenCV capture device (e.g. 0, 1, 2): ") From 6c6b375a660c16645f2a0bf17ec7ba89fcbaa778 Mon Sep 17 00:00:00 2001 From: wuhanstudio Date: Sat, 19 Aug 2023 16:19:10 +0100 Subject: [PATCH 11/14] [example][attack] Add empty noise folder --- examples/attack/.gitignore | 1 - examples/attack/noise/.gitignore | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 examples/attack/noise/.gitignore diff --git a/examples/attack/.gitignore b/examples/attack/.gitignore index 74146de..a3aa79e 100644 --- a/examples/attack/.gitignore +++ b/examples/attack/.gitignore @@ -1,6 +1,5 @@ models/ logs/ -noise/ *.pth *.avi *.npy diff --git a/examples/attack/noise/.gitignore b/examples/attack/noise/.gitignore new file mode 100644 index 0000000..86d0cb2 --- /dev/null +++ b/examples/attack/noise/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file From 743c5dccb7a46fcaa0a3a01e518fcf3f46435c85 Mon Sep 17 00:00:00 2001 From: Han Wu Date: Fri, 6 Oct 2023 13:44:51 +0100 Subject: [PATCH 12/14] [fix] CI Test --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 18d6fe0..c3885bd 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -24,7 +24,7 @@ jobs: python-version: '3.11' # ADJUST THIS: install all dependencies (including pdoc) - - run: pip install pdoc pytest lark + - run: pip install pdoc pytest lark carla - run: pip install -e . # ADJUST THIS: build your documentation into docs/. # We use a custom build script for pdoc itself, ideally you just run `pdoc -o docs/ ...` here. From 85ece3535006fa27cc0f0c8188d6e09616a97b10 Mon Sep 17 00:00:00 2001 From: Han Wu Date: Fri, 6 Oct 2023 13:49:41 +0100 Subject: [PATCH 13/14] Update pytest.yml --- .github/workflows/pytest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c3885bd..38778c0 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -24,8 +24,8 @@ jobs: python-version: '3.11' # ADJUST THIS: install all dependencies (including pdoc) - - run: pip install pdoc pytest lark carla - - run: pip install -e . + - run: python3 -m pip install pdoc pytest lark carla + - run: python3 -m pip install -e . # ADJUST THIS: build your documentation into docs/. # We use a custom build script for pdoc itself, ideally you just run `pdoc -o docs/ ...` here. - run: pytest From aca5a501208b99714a046be135bf022f81849da1 Mon Sep 17 00:00:00 2001 From: Han Wu Date: Fri, 6 Oct 2023 13:55:04 +0100 Subject: [PATCH 14/14] Update pytest.yml --- .github/workflows/pytest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 38778c0..9b4a0a5 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -24,6 +24,7 @@ jobs: python-version: '3.11' # ADJUST THIS: install all dependencies (including pdoc) + - run: python3 -m pip install --upgrade pip - run: python3 -m pip install pdoc pytest lark carla - run: python3 -m pip install -e . # ADJUST THIS: build your documentation into docs/.