Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhanstudio committed Nov 22, 2023
2 parents 33ac4f9 + aca5a50 commit c54131e
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 14 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ jobs:
python-version: '3.11'

# ADJUST THIS: install all dependencies (including pdoc)
- run: pip install pdoc pytest lark
- run: pip install -e .
- 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/.
# We use a custom build script for pdoc itself, ideally you just run `pdoc -o docs/ ...` here.
- run: pytest
1 change: 0 additions & 1 deletion examples/attack/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
models/
logs/
noise/
*.pth
*.avi
*.npy
Expand Down
4 changes: 4 additions & 0 deletions examples/attack/noise/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
2 changes: 1 addition & 1 deletion examples/inference/faster_rcnn_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion examples/inference/mobilenet_v1_ssd_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion examples/inference/mobilenet_v2_ssd_lite_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion examples/inference/yolov3_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion examples/inference/yolov3_tiny_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion examples/inference/yolov4_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion examples/inference/yolov4_tiny_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions what/examples/yolov3_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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): ")

Expand Down
4 changes: 2 additions & 2 deletions what/examples/yolov4_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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): ")

Expand Down

0 comments on commit c54131e

Please sign in to comment.