Skip to content

Commit

Permalink
Merge pull request #803 from roboflow/feature/clean_up_dependencies
Browse files Browse the repository at this point in the history
Pin all dependencies and update to new versions of libs
  • Loading branch information
PawelPeczek-Roboflow authored Nov 14, 2024
2 parents a718390 + 87a69cb commit 868a189
Show file tree
Hide file tree
Showing 54 changed files with 120 additions and 105 deletions.
2 changes: 1 addition & 1 deletion development/stream_interface/workflows_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from inference.core.utils.drawing import create_tiles

STOP = False
ANNOTATOR = sv.BoundingBoxAnnotator()
ANNOTATOR = sv.BoxAnnotator()
fps_monitor = sv.FPSMonitor()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
}

STOP = False
ANNOTATOR = sv.BoundingBoxAnnotator()
ANNOTATOR = sv.BoxAnnotator()
fps_monitor = sv.FPSMonitor()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
}

STOP = False
ANNOTATOR = sv.BoundingBoxAnnotator()
ANNOTATOR = sv.BoxAnnotator()
fps_monitor = sv.FPSMonitor()


Expand Down
4 changes: 2 additions & 2 deletions docker/dockerfiles/Dockerfile.onnx.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RUN pip3 install --upgrade pip && pip3 install \
-r requirements.yolo_world.txt \
-r requirements.transformers.txt \
jupyterlab \
wheel>=0.38.0 \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip

Expand All @@ -51,7 +51,7 @@ COPY --from=base / /
WORKDIR /build
COPY . .
RUN make create_wheels
RUN pip3 install dist/inference_cli*.whl dist/inference_core*.whl dist/inference_cpu*.whl dist/inference_sdk*.whl
RUN pip3 install dist/inference_cli*.whl dist/inference_core*.whl dist/inference_cpu*.whl dist/inference_sdk*.whl setuptools<=75.5.0

RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then pip3 install -r requirements/requirements.vino.txt; rm -rf ~/.cache/pip; fi

Expand Down
4 changes: 2 additions & 2 deletions docker/dockerfiles/Dockerfile.onnx.cpu.dev
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RUN pip3 install --upgrade pip && pip3 install \
-r requirements.yolo_world.txt \
-r requirements.transformers.txt \
jupyterlab \
wheel>=0.38.0 \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip

Expand All @@ -51,7 +51,7 @@ COPY --from=base / /
WORKDIR /build
COPY . .
RUN make create_wheels
RUN pip3 install dist/inference_cli*.whl dist/inference_core*.whl dist/inference_cpu*.whl dist/inference_sdk*.whl
RUN pip3 install dist/inference_cli*.whl dist/inference_core*.whl dist/inference_cpu*.whl dist/inference_sdk*.whl setuptools<=75.5.0
RUN pip3 install watchdog[watchmedo]
RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then pip3 install -r requirements/requirements.vino.txt; rm -rf ~/.cache/pip; fi

Expand Down
2 changes: 1 addition & 1 deletion docker/dockerfiles/Dockerfile.onnx.cpu.parallel
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ RUN pip3 install --upgrade pip && pip3 install \
-r requirements.parallel.txt \
-r requirements.cli.txt \
-r requirements.sdk.http.txt \
wheel>=0.38.0 \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip
RUN apt-get update && apt-get install -y lsb-release curl gpg
Expand Down
2 changes: 1 addition & 1 deletion docker/dockerfiles/Dockerfile.onnx.cpu.slim
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN pip3 install --upgrade pip && pip3 install \
-r requirements.waf.txt \
-r requirements.cli.txt \
-r requirements.sdk.http.txt \
wheel>=0.38.0 \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip

Expand Down
1 change: 1 addition & 0 deletions docker/dockerfiles/Dockerfile.onnx.cpu.stream_manager
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN pip3 install --upgrade pip && pip3 install \
-r _requirements.txt \
-r requirements.cpu.txt \
-r requirements.http.txt \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip

Expand Down
3 changes: 2 additions & 1 deletion docker/dockerfiles/Dockerfile.onnx.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ RUN python3 -m pip install \
-r requirements.yolo_world.txt \
-r requirements.transformers.txt \
jupyterlab \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip

Expand All @@ -60,7 +61,7 @@ WORKDIR /build
COPY . .
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN /bin/make create_wheels_for_gpu_notebook
RUN pip3 install --no-cache-dir dist/inference_cli*.whl dist/inference_core*.whl dist/inference_gpu*.whl dist/inference_sdk*.whl
RUN pip3 install --no-cache-dir dist/inference_cli*.whl dist/inference_core*.whl dist/inference_gpu*.whl dist/inference_sdk*.whl setuptools<=75.5.0

WORKDIR /notebooks
COPY examples/notebooks .
Expand Down
1 change: 1 addition & 0 deletions docker/dockerfiles/Dockerfile.onnx.gpu.dev
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ RUN python3 -m pip install \
-r requirements.sdk.http.txt \
-r requirements.cli.txt \
jupyterlab \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip

Expand Down
3 changes: 2 additions & 1 deletion docker/dockerfiles/Dockerfile.onnx.gpu.parallel
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ RUN pip3 install --upgrade pip && pip3 install \
-r requirements.waf.txt \
-r requirements.gaze.txt \
-r requirements.parallel.txt \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip

Expand All @@ -47,7 +48,7 @@ WORKDIR /build
COPY . .
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN /bin/make create_wheels_for_gpu_notebook
RUN pip3 install dist/inference_cli*.whl dist/inference_core*.whl dist/inference_gpu*.whl dist/inference_sdk*.whl
RUN pip3 install dist/inference_cli*.whl dist/inference_core*.whl dist/inference_gpu*.whl dist/inference_sdk*.whl setuptools<=75.5.0

WORKDIR /notebooks
COPY examples/notebooks .
Expand Down
2 changes: 1 addition & 1 deletion docker/dockerfiles/Dockerfile.onnx.gpu.slim
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN pip3 install --upgrade pip && pip3 install \
-r requirements.waf.txt \
-r requirements.cli.txt \
-r requirements.sdk.http.txt \
wheel>=0.38.0 \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip

Expand Down
1 change: 1 addition & 0 deletions docker/dockerfiles/Dockerfile.onnx.gpu.stream_manager
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ RUN pip3 install --upgrade pip && pip3 install \
-r _requirements.txt \
-r requirements.http.txt \
-r requirements.gpu.txt \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip

Expand Down
1 change: 1 addition & 0 deletions docker/dockerfiles/Dockerfile.onnx.jetson.4.5.0
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ RUN python3.8 -m pip install --upgrade pip wheel Cython && python3.8 -m pip inst
-r requirements.sdk.http.txt \
-r requirements.yolo_world.txt \
jupyterlab \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip

Expand Down
1 change: 1 addition & 0 deletions docker/dockerfiles/Dockerfile.onnx.jetson.4.6.1
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ RUN python3.9 -m pip install --upgrade pip "h5py<=3.10.0" && python3.9 -m pip in
-r requirements.sdk.http.txt \
-r requirements.yolo_world.txt \
jupyterlab \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip

Expand Down
1 change: 1 addition & 0 deletions docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ RUN python3.9 -m pip install --upgrade pip && python3.9 -m pip install \
-r requirements.sdk.http.txt \
-r requirements.yolo_world.txt \
jupyterlab \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ RUN pip3 install --upgrade pip && pip3 install \
-r _requirements.txt \
-r requirements.clip.txt \
-r requirements.http.txt \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip

Expand Down
5 changes: 3 additions & 2 deletions docker/dockerfiles/Dockerfile.onnx.jetson.6.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ RUN python3 -m pip install --upgrade pip && \
-r requirements/requirements.groundingdino.txt \
-r requirements/requirements.sdk.http.txt \
-r requirements/requirements.yolo_world.txt \
-r requirements/requirements.jetson.txt
-r requirements/requirements.jetson.txt \
setuptools<=75.5.0

# Build the application
WORKDIR /build
Expand All @@ -45,7 +46,7 @@ RUN rm -f dist/* && \
python3 .release/pypi/inference.gpu.setup.py bdist_wheel && \
python3 .release/pypi/inference.sdk.setup.py bdist_wheel && \
python3 .release/pypi/inference.cli.setup.py bdist_wheel && \
python3 -m pip install dist/inference_cli*.whl dist/inference_core*.whl dist/inference_gpu*.whl dist/inference_sdk*.whl
python3 -m pip install dist/inference_cli*.whl dist/inference_core*.whl dist/inference_gpu*.whl dist/inference_sdk*.whl setuptools<=75.5.0

# Set up the application runtime
WORKDIR /app
Expand Down
1 change: 1 addition & 0 deletions docker/dockerfiles/Dockerfile.onnx.lambda
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RUN pip3 install \
-r requirements.sdk.http.txt \
-r requirements.yolo_world.txt \
mangum \
setuptools<=75.5.0 \
--upgrade \
--target "${LAMBDA_TASK_ROOT}" \
&& rm -rf ~/.cache/pip
Expand Down
1 change: 1 addition & 0 deletions docker/dockerfiles/Dockerfile.onnx.lambda.slim
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ RUN pip3 install \
-r requirements.hosted.txt \
-r requirements.sdk.http.txt \
mangum \
setuptools<=75.5.0 \
--upgrade \
--target "${LAMBDA_TASK_ROOT}" \
&& rm -rf ~/.cache/pip
Expand Down
1 change: 1 addition & 0 deletions docker/dockerfiles/Dockerfile.onnx.trt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ RUN pip install --upgrade pip && pip install \
-r requirements.doctr.txt \
-r requirements.groundingdino.txt \
-r requirements.sdk.http.txt \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip

Expand Down
1 change: 1 addition & 0 deletions docker/dockerfiles/Dockerfile.onnx.udp.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ RUN pip3 install --upgrade pip && pip3 install \
-r requirements.clip.txt \
-r requirements.http.txt \
-r requirements.gpu.txt \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip

Expand Down
1 change: 1 addition & 0 deletions docker/dockerfiles/Dockerfile.stream_management_api
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN pip3 install --upgrade pip && pip3 install \
-r _requirements.txt \
-r requirements.cpu.txt \
-r requirements.http.txt \
setuptools<=75.5.0 \
--upgrade \
&& rm -rf ~/.cache/pip

Expand Down
2 changes: 1 addition & 1 deletion docs/foundation/paligemma.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ print(response)

detections = from_pali_gemma(response=response, resolution_wh=image.size, class_list=['person', 'car', 'backpack'])

bounding_box_annotator = sv.BoundingBoxAnnotator()
bounding_box_annotator = sv.BoxAnnotator()
label_annotator = sv.LabelAnnotator()

annotatrd_image = bounding_box_annotator.annotate(image, detections)
Expand Down
4 changes: 2 additions & 2 deletions docs/foundation/yolo_world.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ YOLO World is faster than many other zero-shot object detection models like YOLO

detections = sv.Detections.from_inference(results)

bounding_box_annotator = sv.BoundingBoxAnnotator()
bounding_box_annotator = sv.BoxAnnotator()
label_annotator = sv.LabelAnnotator()

labels = [classes[class_id] for class_id in detections.class_id]
Expand Down Expand Up @@ -98,7 +98,7 @@ YOLO World is faster than many other zero-shot object detection models like YOLO

detections = sv.Detections.from_inference(results)

bounding_box_annotator = sv.BoundingBoxAnnotator()
bounding_box_annotator = sv.BoxAnnotator()
label_annotator = sv.LabelAnnotator()

labels = [classes[class_id] for class_id in detections.class_id]
Expand Down
13 changes: 7 additions & 6 deletions docs/inference_helpers/inference_cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ inference infer -i {path_to_your_video_file} -m {your_project}/{version} -o {pat
#### Configuration of visualisation
Option `-c` can be provided with a path to `*.yml` file configuring `supervision` visualisation.
There are few pre-defined configs:
- `bounding_boxes` - with `BoundingBoxAnnotator` and `LabelAnnotator` annotators
- `bounding_boxes_tracing` - with `ByteTracker` and annotators (`BoundingBoxAnnotator`, `LabelAnnotator`)
- `bounding_boxes` - with `BoxAnnotator` and `LabelAnnotator` annotators
- `bounding_boxes_tracing` - with `ByteTracker` and annotators (`BoxAnnotator`, `LabelAnnotator`)
- `masks` - with `MaskAnnotator` and `LabelAnnotator` annotators
- `polygons` - with `PolygonAnnotator` and `LabelAnnotator` annotators

Expand All @@ -255,17 +255,18 @@ annotators:
trace_length: 60
thickness: 2
tracking:
track_thresh: 0.25
track_buffer: 30
match_thresh: 0.8
track_activation_threshold: 0.25
lost_track_buffer: 30
minimum_matching_threshold: 0.8
frame_rate: 30
```
`annotators` field is a list of dictionaries with two keys: `type` and `param`. `type` points to
name of annotator class:
```python
from supervision import *
ANNOTATOR_TYPE2CLASS = {
"bounding_box": BoundingBoxAnnotator,
"bounding_box": BoxAnnotator,
"box": BoxAnnotator,
"mask": MaskAnnotator,
"polygon": PolygonAnnotator,
"color": ColorAnnotator,
Expand Down
1 change: 0 additions & 1 deletion docs/notebooks/inference_pipeline_rtsp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
"zones = [\n",
" sv.PolygonZone(\n",
" polygon=polygon,\n",
" frame_resolution_wh=[1440,2560],\n",
" )\n",
" for polygon\n",
" in polygons\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart/explore_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ results = model.infer(image)[0]
detections = sv.Detections.from_inference(results)

# create supervision annotators
bounding_box_annotator = sv.BoundingBoxAnnotator()
bounding_box_annotator = sv.BoxAnnotator()
label_annotator = sv.LabelAnnotator()

# annotate the image with our inference results
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart/load_from_universe.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ results = model.infer(image)
detections = sv.Detections.from_inference(results[0].dict(by_alias=True, exclude_none=True))

# create supervision annotators
bounding_box_annotator = sv.BoundingBoxAnnotator()
bounding_box_annotator = sv.BoxAnnotator()
label_annotator = sv.LabelAnnotator()

# annotate the image with our inference results
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart/run_model_on_rtsp_webcam.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ import supervision as sv

# create a bounding box annotator and label annotator to use in our custom sink
label_annotator = sv.LabelAnnotator()
box_annotator = sv.BoundingBoxAnnotator()
box_annotator = sv.BoxAnnotator()

def my_custom_sink(predictions: dict, video_frame: VideoFrame):
# get the text labels for each prediction
Expand Down
6 changes: 5 additions & 1 deletion docs/using_inference/http_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ results = client.infer(image_url, model_id=model_id)
### Visualize Results

```python
import os

import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient, InferenceConfiguration

model_id = "soccer-players-5fuqs/1"
Expand All @@ -66,7 +70,7 @@ result = client.infer(image, model_id=model_id)
detections = sv.Detections.from_inference(result)

#Create Supervision annotators
bounding_box_annotator = sv.BoundingBoxAnnotator()
bounding_box_annotator = sv.BoxAnnotator()
label_annotator = sv.LabelAnnotator()

#Extract labels array from inference results
Expand Down
2 changes: 1 addition & 1 deletion docs/using_inference/native_python_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ results = model.infer(image)[0]
detections = sv.Detections.from_inference(results)

# Create Supervision annotators
bounding_box_annotator = sv.BoundingBoxAnnotator()
bounding_box_annotator = sv.BoxAnnotator()
label_annotator = sv.LabelAnnotator()

# Extract labels array from inference results
Expand Down
4 changes: 2 additions & 2 deletions docs/workflows/create_workflow_block.md
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ the method signatures.
crops: Batch[WorkflowImageData],
crops_predictions: Batch[sv.Detections],
) -> BlockResult:
annotator = sv.BoundingBoxAnnotator()
annotator = sv.BoxAnnotator()
visualisations = []
for image, prediction in zip(crops, crops_predictions):
annotated_image = annotator.annotate(
Expand Down Expand Up @@ -1867,7 +1867,7 @@ the method signatures.
images_crops: Batch[Batch[WorkflowImageData]],
crops_predictions: Batch[Batch[sv.Detections]],
) -> BlockResult:
annotator = sv.BoundingBoxAnnotator()
annotator = sv.BoxAnnotator()
visualisations = []
for image_crops, crop_predictions in zip(images_crops, crops_predictions):
visualisations_batch_element = []
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/inference_sdk.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"detections = sv.Detections.from_inference(results)\n",
"\n",
"#Initialize annotators\n",
"bounding_box_annotator = sv.BoundingBoxAnnotator()\n",
"bounding_box_annotator = sv.BoxAnnotator()\n",
"label_annotator = sv.LabelAnnotator()\n",
"\n",
"#Get class labels from inference results\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"detections = sv.Detections.from_inference(result.dict(by_alias=True, exclude_none=True))\n",
"\n",
"#Initialize annotators\n",
"bounding_box_annotator = sv.BoundingBoxAnnotator()\n",
"bounding_box_annotator = sv.BoxAnnotator()\n",
"label_annotator = sv.LabelAnnotator()\n",
"\n",
"#Get class labels from inference results\n",
Expand Down
Loading

0 comments on commit 868a189

Please sign in to comment.