Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion integrations/ultralytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,14 @@ python annotate.py \
zoo:cv/detection/yolo_v3-spp/pytorch/ultralytics/coco/pruned_quant-aggressive_94 \
--source 0 \
--quantized-inputs \
--image-shape 416 416
--image-shape 416 416 \
--no-save # webcam only
```

In addition to webcam `--source` can take a path to a `.jpg` file, directory or glog pat
of `.jpg` files, or path to a `.mp4` video file. If source is an integer and no
corresponding webcam is available, an exception will be raised.


### Benchmarking
`benchmarking.py` is a script for benchmarking sparsified and quantized YOLOv3
Expand Down
5 changes: 4 additions & 1 deletion integrations/ultralytics/deepsparse/deepsparse_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ def __iter__(self) -> Iterator[Tuple[numpy.ndarray, numpy.ndarray]]:
self._stream.release()
cv2.destroyAllWindows()
break
_, frame = self._stream.read()
loaded, frame = self._stream.read()

assert loaded, f"Could not load image from webcam {self._camera}"

frame = cv2.flip(frame, 1) # flip left-right
yield load_image(frame, image_size=self._image_size)

Expand Down