Skip to content

Update pin on numpy version #1107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed
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
8 changes: 4 additions & 4 deletions docker/dockerfiles/Dockerfile.onnx.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ COPY requirements/requirements.sam.txt \
requirements/_requirements.txt \
./

RUN pip3 install --upgrade pip && pip3 install \
RUN pip3 install --upgrade pip && pip3 install --verbose \
-r _requirements.txt \
-r requirements.sam.txt \
-r requirements.clip.txt \
Expand All @@ -52,9 +52,9 @@ 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 "setuptools<=75.5.0"
RUN pip3 install --verbose 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
RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then pip3 install --verbose -r requirements/requirements.vino.txt; rm -rf ~/.cache/pip; fi


WORKDIR /notebooks
Expand All @@ -78,4 +78,4 @@ ENV ENABLE_STREAM_API=True
ENV ENABLE_WORKFLOWS_PROFILING=True
ENV ENABLE_PROMETHEUS=True

ENTRYPOINT uvicorn cpu_http:app --workers $NUM_WORKERS --host $HOST --port $PORT
ENTRYPOINT uvicorn cpu_http:app --workers $NUM_WORKERS --host $HOST --port $PORT
6 changes: 3 additions & 3 deletions docker/dockerfiles/Dockerfile.onnx.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ COPY requirements/requirements.sam.txt \
./

RUN python3 -m pip install -U pip
RUN python3 -m pip install \
RUN python3 -m pip install --verbose \
--extra-index-url https://download.pytorch.org/whl/cu118 \
--extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-11/pypi/simple/ \
-r _requirements.txt \
Expand All @@ -49,10 +49,10 @@ RUN python3 -m pip install \
&& rm -rf ~/.cache/pip

# Install setup.py requirements for flash_attn
RUN python3 -m pip install packaging==24.1 && rm -rf ~/.cache/pip
RUN python3 -m pip install --verbose packaging==24.1 && rm -rf ~/.cache/pip

# Install flash_attn required for Paligemma and Florence2
RUN python3 -m pip install -r requirements.pali.flash_attn.txt --no-dependencies --no-build-isolation && rm -rf ~/.cache/pip
RUN python3 -m pip install --verbose -r requirements.pali.flash_attn.txt --no-dependencies --no-build-isolation && rm -rf ~/.cache/pip

# Start runtime stage
FROM nvcr.io/nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 as runtime
Expand Down
6 changes: 3 additions & 3 deletions docker/dockerfiles/Dockerfile.onnx.gpu.dev
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ COPY requirements/requirements.sam.txt \
./

RUN python3 -m pip install -U pip
RUN python3 -m pip install \
RUN python3 -m pip install --verbose \
--extra-index-url https://download.pytorch.org/whl/cu118 \
--extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-11/pypi/simple/ \
-r _requirements.txt \
Expand All @@ -54,10 +54,10 @@ RUN python3 -m pip install \
&& rm -rf ~/.cache/pip

# Install setup.py requirements for flash_attn
RUN python3 -m pip install packaging==24.1 && rm -rf ~/.cache/pip
RUN python3 -m pip install --verbose packaging==24.1 && rm -rf ~/.cache/pip

# Install flash_attn required for Paligemma and Florence2
RUN python3 -m pip install -r requirements.pali.flash_attn.txt --no-dependencies --no-build-isolation && rm -rf ~/.cache/pip
RUN python3 -m pip install --verbose -r requirements.pali.flash_attn.txt --no-dependencies --no-build-isolation && rm -rf ~/.cache/pip

WORKDIR /app/
COPY inference inference
Expand Down
4 changes: 2 additions & 2 deletions docker/dockerfiles/Dockerfile.onnx.jetson.4.6.1
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ COPY requirements/requirements.clip.txt \

RUN python3.9 -m pip install --ignore-installed PyYAML && rm -rf ~/.cache/pip

RUN python3.9 -m pip install --upgrade pip "h5py<=3.10.0" && python3.9 -m pip install \
RUN python3.9 -m pip install --upgrade pip "h5py<=3.10.0" && python3.9 -m pip install --verbose \
-r _requirements.txt \
-r requirements.clip.txt \
-r requirements.http.txt \
Expand All @@ -66,7 +66,7 @@ RUN python3.9 -m pip install --upgrade pip "h5py<=3.10.0" && python3.9 -m pip in

RUN python3.9 -m pip uninstall --yes onnxruntime
RUN wget https://nvidia.box.com/shared/static/jmomlpcctmjojz14zbwa12lxmeh2h6o5.whl -O onnxruntime_gpu-1.11.0-cp39-cp39-linux_aarch64.whl
RUN python3.9 -m pip install onnxruntime_gpu-1.11.0-cp39-cp39-linux_aarch64.whl \
RUN python3.9 -m pip install --verbose onnxruntime_gpu-1.11.0-cp39-cp39-linux_aarch64.whl \
&& rm -rf ~/.cache/pip \
&& rm onnxruntime_gpu-1.11.0-cp39-cp39-linux_aarch64.whl

Expand Down
4 changes: 2 additions & 2 deletions docker/dockerfiles/Dockerfile.onnx.jetson.5.1.1
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN wget https://storage.googleapis.com/roboflow-tests-assets/zxing_cpp_library_
&& mv zxingcpp.cpython-39-aarch64-linux-gnu.so /usr/local/lib/python3.9/dist-packages/ \
&& rm zxing_cpp_library_compiled_for_inference_v0.12.1.tar.gz

RUN python3.9 -m pip install --upgrade pip && python3.9 -m pip install \
RUN python3.9 -m pip install --upgrade pip && python3.9 -m pip install --verbose \
-r _requirements.txt \
-r requirements.clip.txt \
-r requirements.http.txt \
Expand All @@ -59,7 +59,7 @@ RUN python3.9 -m pip install --upgrade pip && python3.9 -m pip install \

RUN python3.9 -m pip uninstall --yes onnxruntime
RUN wget https://nvidia.box.com/shared/static/67zek28z497hs9aev7xg2c1wngdeyv4h.whl -O onnxruntime_gpu-1.16.0-cp39-cp39-linux_aarch64.whl
RUN python3.9 -m pip install onnxruntime_gpu-1.16.0-cp39-cp39-linux_aarch64.whl "opencv-python-headless>4,<=4.10.0.84" \
RUN python3.9 -m pip install --verbose onnxruntime_gpu-1.16.0-cp39-cp39-linux_aarch64.whl "opencv-python-headless>4,<=4.10.0.84" \
&& rm -rf ~/.cache/pip \
&& rm onnxruntime_gpu-1.16.0-cp39-cp39-linux_aarch64.whl

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUN wget https://storage.googleapis.com/roboflow-tests-assets/zxing_cpp_library_
&& mv zxingcpp.cpython-39-aarch64-linux-gnu.so /usr/local/lib/python3.9/dist-packages/ \
&& rm zxing_cpp_library_compiled_for_inference_v0.12.1.tar.gz

RUN python3.9 -m pip install --upgrade pip && python3.9 -m pip install \
RUN python3.9 -m pip install --upgrade pip && python3.9 -m pip install --verbose \
-r _requirements.txt \
-r requirements.clip.txt \
-r requirements.http.txt \
Expand All @@ -50,7 +50,7 @@ RUN python3.9 -m pip install --upgrade pip && python3.9 -m pip install \

RUN python3.9 -m pip uninstall --yes onnxruntime
RUN wget https://nvidia.box.com/shared/static/67zek28z497hs9aev7xg2c1wngdeyv4h.whl -O onnxruntime_gpu-1.16.0-cp39-cp39-linux_aarch64.whl
RUN python3.9 -m pip install onnxruntime_gpu-1.16.0-cp39-cp39-linux_aarch64.whl "opencv-python-headless>4,<=4.10.0.84" \
RUN python3.9 -m pip install --verbose onnxruntime_gpu-1.16.0-cp39-cp39-linux_aarch64.whl "opencv-python-headless>4,<=4.10.0.84" \
&& rm -rf ~/.cache/pip \
&& rm onnxruntime_gpu-1.16.0-cp39-cp39-linux_aarch64.whl

Expand Down
4 changes: 2 additions & 2 deletions docker/dockerfiles/Dockerfile.onnx.jetson.6.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN sed -i '/^opencv-python/d;/^onnxruntime/d;/^opencv-python-contrib/d' require

# Upgrade pip and install Python packages
RUN python3 -m pip install --upgrade pip && \
python3 -m pip install --upgrade \
python3 -m pip install --verbose --upgrade \
-r requirements/_requirements.txt \
-r requirements/requirements.clip.txt \
-r requirements/requirements.http.txt \
Expand All @@ -48,7 +48,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 "setuptools<=75.5.0"
python3 -m pip install --verbose 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
2 changes: 1 addition & 1 deletion docker/dockerfiles/Dockerfile.onnx.lambda
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ COPY requirements/requirements.clip.txt \
RUN if [ "${TARGETPLATFORM}" == "linux/amd64" ]; then mv requirements.vino.txt requirements.cpu.txt; fi

RUN /var/lang/bin/python3.10 -m pip install --upgrade pip && rm -rf ~/.cache/pip
RUN pip3 install \
RUN pip3 install --verbose \
--extra-index-url https://download.pytorch.org/whl/cpu \
certifi==2022.12.07 \
-r _requirements.txt \
Expand Down
2 changes: 1 addition & 1 deletion docker/dockerfiles/Dockerfile.onnx.trt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ COPY requirements/requirements.sam.txt \
requirements/requirements.sdk.http.txt \
./

RUN pip install --upgrade pip && pip install \
RUN pip install --upgrade pip && pip install --verbose \
--extra-index-url https://download.pytorch.org/whl/cu118 \
--extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-11/pypi/simple/ \
-r _requirements.txt \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import math
from typing import List, Literal, Optional, Type, Union

import numpy as np
Expand Down Expand Up @@ -210,7 +211,7 @@ def run(
)

z_score = (cs - self.cosine_similarity_avg) / self.cosine_similarity_std
percentile = 1 - 0.5 * (1 + np.math.erf(z_score / np.sqrt(2)))
percentile = 1 - 0.5 * (1 + math.erf(z_score / np.sqrt(2)))

# print(f"Z-score: {z_score}, Percentile: {percentile}, Cosine Similarity: {cs}, Average: {self.cosine_similarity_avg}, Std: {self.cosine_similarity_std}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def calculate_minimum_bounding_rectangle(

rect = cv.minAreaRect(largest_contour)
box = cv.boxPoints(rect)
box = np.int0(box)
box = np.array(box, dtype=int)

width, height = rect[1]
angle = rect[2]
Expand Down
84 changes: 42 additions & 42 deletions requirements/_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
aiortc~=1.9.0
APScheduler>=3.10.1,<4.0.0
asyncua~=1.1.5
cachetools<6.0.0
cython~=3.0.0
python-dotenv~=1.0.0
fastapi>=0.100,<0.111 # be careful with upper pin - fastapi might remove support for on_event
numpy<=1.26.4
aiortc
APScheduler
asyncua
cachetools
cython
python-dotenv
fastapi # be careful with upper pin - fastapi might remove support for on_event
numpy>=2.0.0,<3.0.0
opencv-python>=4.8.1.78,<=4.10.0.84
opencv-contrib-python>=4.8.1.78,<=4.10.0.84 # Note: opencv-python considers this as a bad practice, but since our dependencies rely on both we pin both here
pillow<11.0
prometheus-fastapi-instrumentator<=6.0.0
redis~=5.0.0
requests>=2.32.0,<3.0.0
rich>=13.0.0,<13.10.0
supervision>=0.25.1,<=0.30.0
pybase64~=1.0.0
scikit-image>=0.19.0,<=0.24.0
requests-toolbelt~=1.0.0
wheel>=0.38.1,<=0.45.0
setuptools>=70.0.0 # lack of upper-bound to ensure compatibility with Google Colab (builds to define one if needed)
networkx~=3.1
pydantic~=2.6
pydantic-settings~=2.2
openai>=1.12.0,<2.0.0
structlog>=24.1.0,<25.0.0
zxing-cpp~=2.2.0
boto3<=1.35.60
typing_extensions>=4.8.0,<=4.12.2
pydot~=2.0.0
shapely>=2.0.0,<2.1.0
tldextract~=5.1.2
packaging~=24.0
anthropic~=0.34.2
pandas>=2.0.0,<2.3.0
paho-mqtt~=1.6.1
pytest>=8.0.0,<9.0.0 # this is not a joke, sam2 requires this as the fork we are using is dependent on that, yet
pillow
prometheus-fastapi-instrumentator
redis
requests
rich
supervision
pybase64
scikit-image
requests-toolbelt
wheel
setuptools # lack of upper-bound to ensure compatibility with Google Colab (builds to define one if needed)
networkx
pydantic
pydantic-settings
openai
structlog
zxing-cpp
boto3
typing_extensions
pydot
shapely
tldextract
packaging
anthropic
pandas
paho-mqtt
pytest # this is not a joke, sam2 requires this as the fork we are using is dependent on that, yet
# do not mark the dependency: https://github.com/SauravMaheshkar/samv2/blob/main/sam2/utils/download.py
tokenizers>=0.19.0,<0.22.0
slack-sdk~=3.33.4
twilio~=9.3.7
tokenizers
slack-sdk
twilio
httpx>=0.25.1,<0.28.0 # must be pinned as bc in 0.28.0 is causing Anthropics to fail
pylogix==1.0.5
pymodbus>=3.6.9,<=3.8.3
backoff~=2.2.0
filelock>=3.12.0,<=3.17.0
pylogix
pymodbus
backoff
filelock
32 changes: 16 additions & 16 deletions requirements/requirements.cli.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
requests>=2.32.0,<3.0.0
docker>=7.0.0,<8.0.0
typer>=0.9.0,<=0.12.5
rich>=13.0.0,<13.10.0
PyYAML~=6.0.0
supervision>=0.25.1,<=0.30.0
opencv-python>=4.8.1.78,<=4.10.0.84
tqdm>=4.0.0,<5.0.0
nvidia-ml-py<13.0.0
py-cpuinfo~=9.0.0
aiohttp>=3.9.0,<=3.10.11
backoff~=2.2.0
pandas>=2.0.0,<2.3.0
rich~=13.0.0
pybase64~=1.0.0
pydantic~=2.6
requests
docker
typer
rich
PyYAML
supervision
opencv-python
tqdm
nvidia-ml-py
py-cpuinfo
aiohttp
backoff
pandas
rich
pybase64
pydantic
2 changes: 1 addition & 1 deletion requirements/requirements.clip.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rf-clip==1.1
rf-clip
4 changes: 2 additions & 2 deletions requirements/requirements.cpu.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
onnxruntime>=1.15.1,<1.20.0
nvidia-ml-py<13.0.0
onnxruntime
nvidia-ml-py
4 changes: 2 additions & 2 deletions requirements/requirements.doctr.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python-doctr[torch]>=0.7.0,<=0.10.0
tf2onnx~=1.16.0
python-doctr[torch]
tf2onnx
2 changes: 1 addition & 1 deletion requirements/requirements.gaze.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mediapipe>=0.9,<0.11
mediapipe
2 changes: 1 addition & 1 deletion requirements/requirements.gpu.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
onnxruntime-gpu>=1.15.1,<1.20.0
onnxruntime-gpu>1.17.1,<=1.21.0
2 changes: 1 addition & 1 deletion requirements/requirements.groundingdino.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rf_groundingdino==0.2.0
rf_groundingdino
4 changes: 2 additions & 2 deletions requirements/requirements.hosted.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pymemcache~=4.0.0
elasticache_auto_discovery~=1.0.0
pymemcache
elasticache_auto_discovery
10 changes: 5 additions & 5 deletions requirements/requirements.http.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
uvicorn[standard]<=0.34.0
python-multipart==0.0.19
fastapi-cprofile<=0.0.2
orjson>=3.9.10,<=3.10.11
asgi_correlation_id~=4.3.1
uvicorn[standard]
python-multipart
fastapi-cprofile
orjson
asgi_correlation_id
8 changes: 4 additions & 4 deletions requirements/requirements.jetson.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pypdfium2~=4.0.0
jupyterlab>=4.3.0,<5.0.0
PyYAML~=6.0.0
onnxruntime-gpu>=1.15.1,<1.20.0
pypdfium2
jupyterlab
PyYAML
onnxruntime-gpu>1.17.1,<=1.21.0
4 changes: 2 additions & 2 deletions requirements/requirements.pali.flash_attn.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
flash-attn==2.5.9.post1
xformers>=0.0.27.post2
flash-attn
xformers
4 changes: 2 additions & 2 deletions requirements/requirements.parallel.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
celery>=5.4.0,<6.0.0
gunicorn~=23.0.0
celery
gunicorn
10 changes: 5 additions & 5 deletions requirements/requirements.sam.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rf-segment-anything==1.0
samv2==0.0.4
rasterio~=1.3
torch>=2.0.1,<=2.4.0
torchvision>=0.15.2
rf-segment-anything
samv2
rasterio
torch
torchvision
Loading
Loading