Giter Club home page Giter Club logo

roboflow / inference Goto Github PK

View Code? Open in Web Editor NEW
1.0K 19.0 72.0 59.2 MB

A fast, easy-to-use, production-ready inference server for computer vision supporting deployment of many popular model architectures and fine-tuned models.

Home Page: https://inference.roboflow.com

License: Other

Python 96.77% Makefile 0.10% Roff 0.19% Shell 0.40% JavaScript 0.01% HTML 1.44% TypeScript 0.77% CSS 0.04% Slim 0.20% Smarty 0.08%
computer-vision inference-api inference-server vit yolact yolov5 yolov7 yolov8 jetson tensorrt

inference's Introduction

๐Ÿ‘‹ hello

Roboflow Inference is an open-source platform designed to simplify the deployment of computer vision models. It enables developers to perform object detection, classification, and instance segmentation and utilize foundation models like CLIP, Segment Anything, and YOLO-World through a Python-native package, a self-hosted inference server, or a fully managed API.

Explore our enterprise options for advanced features like server deployment, device management, active learning, and commercial licenses for YOLOv5 and YOLOv8.

๐Ÿ’ป install

Inference package requires Python>=3.8,<=3.11. Click here to learn more about running Inference inside Docker.

pip install inference
๐Ÿ‘‰ additional considerations
  • hardware

    Enhance model performance in GPU-accelerated environments by installing CUDA-compatible dependencies.

    pip install inference-gpu
  • models

    The inference and inference-gpu packages install only the minimal shared dependencies. Install model-specific dependencies to ensure code compatibility and license compliance. Learn more about the models supported by Inference.

    pip install inference[yolo-world]

๐Ÿ”ฅ quickstart

Use Inference SDK to run models locally with just a few lines of code. The image input can be a URL, a numpy array (BGR), or a PIL image.

from inference import get_model

model = get_model(model_id="yolov8n-640")

results = model.infer("https://media.roboflow.com/inference/people-walking.jpg")
๐Ÿ‘‰ roboflow models

Set up your ROBOFLOW_API_KEY to access thousands of fine-tuned models shared by the Roboflow Universe community and your custom model. Navigate to ๐Ÿ”‘ keys section to learn more.

from inference import get_model

model = get_model(model_id="soccer-players-5fuqs/1")

results = model.infer(
    image="https://media.roboflow.com/inference/soccer.jpg",
    confidence=0.5,
    iou_threshold=0.5
)
๐Ÿ‘‰ foundational models
  • CLIP Embeddings - generate text and image embeddings that you can use for zero-shot classification or assessing image similarity.

    from inference.models import Clip
    
    model = Clip()
    
    embeddings_text = clip.embed_text("a football match")
    embeddings_image = model.embed_image("https://media.roboflow.com/inference/soccer.jpg")
  • Segment Anything - segment all objects visible in the image or only those associated with selected points or boxes.

    from inference.models import SegmentAnything
    
    model = SegmentAnything()
    
    result = model.segment_image("https://media.roboflow.com/inference/soccer.jpg")
  • YOLO-World - an almost real-time zero-shot detector that enables the detection of any objects without any training.

    from inference.models import YOLOWorld
    
    model = YOLOWorld(model_id="yolo_world/l")
    
    result = model.infer(
        image="https://media.roboflow.com/inference/dog.jpeg",
        text=["person", "backpack", "dog", "eye", "nose", "ear", "tongue"],
        confidence=0.03
    )

๐Ÿ“Ÿ inference server

  • deploy server

    The inference server is distributed via Docker. Behind the scenes, inference will download and run the image that is appropriate for your hardware. Here, you can learn more about the supported images.

    inference server start
  • run client

    Consume inference server predictions using the HTTP client available in the Inference SDK.

    from inference_sdk import InferenceHTTPClient
    
    client = InferenceHTTPClient(
        api_url="http://localhost:9001",
        api_key=<ROBOFLOW_API_KEY>
    )
    with client.use_model(model_id="soccer-players-5fuqs/1"):
        predictions = client.infer("https://media.roboflow.com/inference/soccer.jpg")

    If you're using the hosted API, change the local API URL to https://detect.roboflow.com. Accessing the hosted inference server and/or using any of the fine-tuned models require a ROBOFLOW_API_KEY. For further information, visit the ๐Ÿ”‘ keys section.

๐ŸŽฅ inference pipeline

The inference pipeline is an efficient method for processing static video files and streams. Select a model, define the video source, and set a callback action. You can choose from predefined callbacks that allow you to display results on the screen or save them to a file.

from inference import InferencePipeline
from inference.core.interfaces.stream.sinks import render_boxes

pipeline = InferencePipeline.init(
    model_id="yolov8x-1280",
    video_reference="https://media.roboflow.com/inference/people-walking.mp4",
    on_prediction=render_boxes
)

pipeline.start()
pipeline.join()

๐Ÿ”‘ keys

Inference enables the deployment of a wide range of pre-trained and foundational models without an API key. To access thousands of fine-tuned models shared by the Roboflow Universe community, configure your API key.

export ROBOFLOW_API_KEY=<YOUR_API_KEY>

๐Ÿ“š documentation

Visit our documentation to explore comprehensive guides, detailed API references, and a wide array of tutorials designed to help you harness the full potential of the Inference package.

ยฉ license

The Roboflow Inference code is distributed under the Apache 2.0 license. However, each supported model is subject to its licensing. Detailed information on each model's license can be found here.

๐Ÿ† contribution

We would love your input to improve Roboflow Inference! Please see our contributing guide to get started. Thank you to all of our contributors! ๐Ÿ™


inference's People

Contributors

artemwheat avatar artyaltanzaya avatar bigbitbus avatar capjamesg avatar chandlersupple avatar dependabot[bot] avatar github-actions[bot] avatar grzegorz-roboflow avatar hansent avatar hvaria avatar jchens avatar josephofiowa avatar kresetar avatar linasko avatar onuralpszr avatar pacificdou avatar paulguerrie avatar pawelpeczek-roboflow avatar probicheaux avatar robiscoding avatar ryanjball avatar sberan avatar shingomatsuura avatar skalskip avatar skylargivens avatar solomonlake avatar stellasphere avatar tonylampada avatar yeldarby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inference's Issues

Include `class_id` and `class_list` in inference response

Adding the class_id value to the inference response would help simplify the API between supervision and inference. sv.Detections requires int value representing class_id. Currently, we force users to provide class_list as one of the arguments of sv.Detections.from_roboflow method to perform the mapping. We could drop that requirement if class_id was provided.

sv.Detections.from_roboflow is the only connector that requires an additional class_list argument. All other connectors: from_detectron2, from_mmdetection, from_paddledet, from_sam, from_transformers, from_ultralytics, from_yolo_nas, from_yolov5 and from_yolov8 can retrieve class_id from inference result object. It is a common standard in computer vision.

Before

>>> import supervision as sv

>>> roboflow_result = {
...     "predictions": [
...         {
...             "x": 0.5,
...             "y": 0.5,
...             "width": 0.2,
...             "height": 0.3,
...             "class": "person",
...             "confidence": 0.9
...         },
...         # ... more predictions ...
...     ]
... }
>>> class_list = ["person", "car", "dog"]

>>> detections = sv.Detections.from_roboflow(roboflow_result, class_list)

After

>>> import supervision as sv

>>> roboflow_result = {
...     "predictions": [
...         {
...             "x": 0.5,
...             "y": 0.5,
...             "width": 0.2,
...             "height": 0.3,
...             "class": "person",
...             "class_id": 0,
...             "confidence": 0.9
...         },
...         # ... more predictions ...
...     ]
... }

>>> detections = sv.Detections.from_roboflow(roboflow_result)

๐Ÿ™‹๐Ÿป I would love to work on the implementation of this feature.

GPG Keys not avaliable

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

I am trying to build a Docker image locally, from the Inference Server repository.
facing an error during the build process.

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB]
Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Err:1 http://deb.debian.org/debian bookworm InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY F8D2585B8783D481
Err:2 http://deb.debian.org/debian bookworm-updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
Err:3 http://deb.debian.org/debian-security bookworm-security InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8
Reading package lists...
W: GPG error: http://deb.debian.org/debian bookworm InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY F8D2585B8783D481
E: The repository 'http://deb.debian.org/debian bookworm InRelease' is not signed.
W: GPG error: http://deb.debian.org/debian bookworm-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
E: The repository 'http://deb.debian.org/debian bookworm-updates InRelease' is not signed.
W: GPG error: http://deb.debian.org/debian-security bookworm-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8
E: The repository 'http://deb.debian.org/debian-security bookworm-security InRelease' is not signed.
E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
E: Sub-process returned an error code
The command '/bin/sh -c apt update -y && apt install -y     ffmpeg     libxext6     libopencv-dev     uvicorn     python3-pip     git     libgdal-dev     && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

Environment

  • OS: Fedora
  • Docker: version 1.13.1, build 7d71120/1.13.1

Minimal Reproducible Example

No response

Additional

i believe issue will be solved if we use python bullseye or any particular latest version of Debian.
its just a hunch

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

inference.core.exceptions.ModelArtefactError: Unable to load ONNX session. Cause: [ONNXRuntimeError] : 7 : INVALID_PROTOBUF : Load model from /tmp/cache\chinese-calligraphy-recognition-sl0eb/2\best.onnx failed:Protobuf parsing failed.

Search before asking

  • I have searched the Inference issues and found no similar feature requests.

Question

I apologize for any confusion my explanation may cause. Iโ€™m a beginner and I need to use roboflow inference to complete my project. Thereโ€™s a problem that needs to be solved.

Hereโ€™s the situation:
When using the get_model() function to get the model, an error occurred, as follows:

  1. When getting the model (model_id: kitchenfire/1), everything went smoothly;
  2. When getting the model (model_id: chinese-calligraphy-styles/1) and the model (model_id: chinese-calligraphy-recognition-sl0eb/2), the following error message was displayed in the python terminal:
C:\Users\Sui\anaconda3\envs\CCRS_ps-pms-if\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py:65: UserWarning: Specified provider 'OpenVINOExecutionProvider' is not in available provider names.Available providers: 'TensorrtExecutionProvider, CUDAExecutionProvider, CPUExecutionProvider'
  warnings.warn(
Traceback (most recent call last):
  File "C:\Users\Sui\anaconda3\envs\CCRS_ps-pms-if\Lib\site-packages\inference\core\models\roboflow.py", line 713, in initialize_model
    self.onnx_session = onnxruntime.InferenceSession(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Sui\anaconda3\envs\CCRS_ps-pms-if\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 383, in __init__   
    self._create_inference_session(providers, provider_options, disabled_optimizers)
  File "C:\Users\Sui\anaconda3\envs\CCRS_ps-pms-if\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 424, in _create_inference_session
    sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxruntime.capi.onnxruntime_pybind11_state.InvalidProtobuf: [ONNXRuntimeError] : 7 : INVALID_PROTOBUF : Load model from /tmp/cache\chinese-calligraphy-recognition-sl0eb/2\best.onnx failed:Protobuf parsing failed.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "d:\OTHERs\Windows Shortcut Folder\Documents\Code Projects\VS Code Projects\CCRS\test.py", line 4, in <module>
    model = inference.get_model("chinese-calligraphy-recognition-sl0eb/2", api_key=__ApiKey)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Sui\anaconda3\envs\CCRS_ps-pms-if\Lib\site-packages\inference\models\utils.py", line 195, in get_model
    return ROBOFLOW_MODEL_TYPES[(task, model)](model_id, api_key=api_key, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Sui\anaconda3\envs\CCRS_ps-pms-if\Lib\site-packages\inference\models\vit\vit_classification.py", line 26, in __init__
    super().__init__(*args, **kwargs)
  File "C:\Users\Sui\anaconda3\envs\CCRS_ps-pms-if\Lib\site-packages\inference\core\models\classification_base.py", line 40, in __init__
    super().__init__(*args, **kwargs)
  File "C:\Users\Sui\anaconda3\envs\CCRS_ps-pms-if\Lib\site-packages\inference\core\models\roboflow.py", line 612, in __init__
    self.initialize_model()
  File "C:\Users\Sui\anaconda3\envs\CCRS_ps-pms-if\Lib\site-packages\inference\core\models\roboflow.py", line 720, in initialize_model
    raise ModelArtefactError(
inference.core.exceptions.ModelArtefactError: Unable to load ONNX session. Cause: [ONNXRuntimeError] : 7 : INVALID_PROTOBUF : Load model from /tmp/cache\chinese-calligraphy-recognition-sl0eb/2\best.onnx failed:Protobuf parsing failed.

Additional

No response

Inference on video is extremely slow

Hi,
Ran the code as metioned in the official [docs] (https://inference.roboflow.com/quickstart/run_model_on_rtsp_webcam/#installation)
But the output seems to be in a very slow frame rate.
any advice?

# Import the InferencePipeline object
from inference import InferencePipeline
# Import the built in render_boxes sink for visualizing results
from inference.core.interfaces.stream.sinks import render_boxes

# initialize a pipeline object
pipeline = InferencePipeline.init(
    model_id="rock-paper-scissors-sxsw/11", # Roboflow model to use
    video_reference=0, # Path to video, device id (int, usually 0 for built in webcams), or RTSP stream url
    on_prediction=render_boxes, # Function to run after each prediction
)
pipeline.start()
pipeline.join()

Update description for workflows steps

Search before asking

  • I have searched the Inference issues and found no similar feature requests.

Description

Update workflows steps descriptions - start with verbs in these sentences, noting the action each block will take.

Use case

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Batch Inference

Search before asking

  • I have searched the Inference issues and found no similar feature requests.

Question

Is batch inference possible? For models that support it? I am currently using Triton Server directly, which supports arrays of inputs, but I'd like to try to use Inference Server, which seems to be a level of abstraction higher (specially once you support custom, non Roboflow weights). But I got significant performance improvements from infering in batches (yolov8) vs infering an image at a time.

Additional

No response

orjson conversion is faulty

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

JSON serialisation introduced in #166 is faulty when used against requests to /v1 endpoints that require visualisation - due to presence of field visualization with binary content in response

Traceback (most recent call last):
  File "/app/inference/core/interfaces/http/http_api.py", line 133, in wrapped_route
    return await route(*args, **kwargs)
  File "/app/inference/core/interfaces/http/http_api.py", line 487, in infer_object_detection
    return await process_inference_request(
  File "/app/inference/core/interfaces/http/http_api.py", line 287, in process_inference_request
    return orjson_response(resp)
  File "/app/inference/core/interfaces/http/http_api.py", line 115, in orjson_response
    return ORJSONResponse(content=content)
  File "/usr/local/lib/python3.9/site-packages/starlette/responses.py", line 196, in __init__
    super().__init__(content, status_code, headers, media_type, background)
  File "/usr/local/lib/python3.9/site-packages/starlette/responses.py", line 55, in __init__
    self.body = self.render(content)
  File "/usr/local/lib/python3.9/site-packages/fastapi/responses.py", line 34, in render
    return orjson.dumps(
TypeError: Type is not JSON serializable: bytes
INFO:     192.168.65.1:19999 - "POST /infer/object_detection HTTP/1.1" 500 Internal Server Error

Environment

No response

Minimal Reproducible Example

run HTTP container from main

from inference_sdk import InferenceHTTPClient, InferenceConfiguration, VisualisationResponseFormat

LOCALHOST_CLIENT = InferenceHTTPClient(
    api_url="http://127.0.0.1:9001",
    api_key=API_KEYS["MY_PRIVATE_WORKSPACE_API_KEY"],
)
config = InferenceConfiguration(
    visualize_predictions=True,
)

with LOCALHOST_CLIENT.use_configuration(config):
    r = LOCALHOST_CLIENT.infer(
        DATASET["asl"][0],
        model_id="barbel-detection/2",
    )

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Hello, how does the local computer run to obtain the prediction label and detect the bbox coordinates?

Search before asking

  • I have searched the Inference issues and found no similar feature requests.

Question

Hello, how does the local computer run to obtain the prediction label and detect the bbox coordinates?
The following is my code, please take a look at it for me, thank you very much (I am running on a local computer, do not use API KEY)::

from inference import InferencePipeline
from inference.core.interfaces.stream.sinks import VideoFileSink

video_sink = VideoFileSink.init(video_file_name="output.avi")

pipeline = InferencePipeline.init_with_yolo_world(
    video_reference="./video_1.mp4",
    classes=["person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat", "traffic light",
             "fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat", "dog", "horse", "sheep", "cow",
             "elephant", "bear", "zebra", "giraffe", "backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee",
             "skis", "snowboard", "sports ball", "kite", "baseball bat", "baseball glove", "skateboard", "surfboard",
             "tennis racket", "bottle", "wine glass", "cup", "fork", "knife", "spoon", "bowl", "banana", "apple",
             "sandwich", "orange", "broccoli", "carrot", "hot dog", "pizza", "donut", "cake", "couch",
             "potted plant", "bed", "dining table", "toilet", "tv", "laptop", "mouse", "remote", "keyboard",
             "cell phone", "microwave", "oven", "toaster", "sink", "refrigerator", "book", "clock", "vase", "scissors",
             "teddy bear", "hair drier", "toothbrush", "faucet", "Trash can", "chair", "Refrigerator"],
    model_size="s",
    on_prediction=video_sink.on_prediction,
)
# start the pipeline
pipeline.start()
# wait for the pipeline to finish
pipeline.join()

video_sink.release()

Additional

No response

How can I use custom weights with Yolo-World Model?

Search before asking

  • I have searched the Inference issues and found no similar feature requests.

Question

The model performance of the Yolo World Hugging Face model (https://huggingface.co/spaces/stevengrove/YOLO-World) is better for my purpose than the standard inference one "yolo_world/v2-x" for example.

Because my lack of domain knowledge regarding this topics I can't make the HF model work on my Mac (not an M processor) so I would like to be able to use the model weights with the abstraction from the Roboflow inference library.

Is there any way to use the author's provided weights together with the inference library?

From the author's instruction on how to run the model on an image one needs the configuration file and the weights: https://github.com/AILab-CVC/YOLO-World

The conf file I want to use and the weights are available here:
https://huggingface.co/spaces/stevengrove/YOLO-World/blob/main/configs/pretrain/yolo_world_l_t2i_bn_2e-4_100e_4x8gpus_obj365v1_goldg_train_lvis_minival.py
https://huggingface.co/spaces/stevengrove/YOLO-World/blob/main/yolow-v8_l_clipv2_frozen_t2iv2_bn_o365_goldg_pretrain.pth

Thank you in advance

Additional

No response

Inference Server on NVIDIA Jetson with JP5.1.1 and TensorRT support

Hello,

I have a Jetson Orin NX 16GB running JetPack 5.1.1 and want to run Roboflow open-source inference server on the device.

I am able to successfully do this using the docker command which utilizes TensorRT:

docker run --privileged --net=host --runtime=nvidia roboflow/roboflow-inference-server-trt-jetson-5.1.1:latest

But, how can I also utilize TensorRT with the open-source inference server running on the Jetson device?

Here I have installed the inference server via pip install inference-gpu on the Jetson.

Best Regards,
Lakshantha

Add error status code to benchmark output

Search before asking

  • I have searched the Inference issues and found no similar feature requests.

Description

Adding status code to benchmark output would help to distinguish between API gateway rate limiting and actual errors (i.e. 500)

Use case

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Error Running cogvlm model on Self-Hosted GPU Server with Roboflow Inference (Transformer Version)

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

I'm encountering an issue while attempting to deploy the cogvlm model on my own GPU server using Roboflow inference code. The server setup seems to be correct, but when I try to run the model, I run into the following error:

  File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 3502, in from_pretrained
    ):
  File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 3926, in _load_pretrained_model
    model._is_quantized_training_enabled = True
  File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 802, in _load_state_dict_into_meta_model
    state_dict_index = offload_weight(param, param_name, state_dict_folder, state_dict_index)
  File "/usr/local/lib/python3.10/dist-packages/transformers/quantizers/quantizer_bnb_4bit.py", line 124, in check_quantized_param
KeyError: 'inv_freq'
INFO:     172.17.0.1:45116 - "POST /llm/cogvlm HTTP/1.1" 500 Internal Server Error

Upon further investigation and based on this GitHub issue (THUDM/CogVLM#396), it's recommended to downgrade the transformers library to version 4.37 due to compatibility issues. However, the current deployment is using version 4.38. Could you please confirm if the transformers version could be the source of this issue and if downgrading would be appropriate? Any other insights or suggestions would also be greatly appreciated.
Thank you!

Environment

inference 0.9.20
inference-cli 0.9.20
inference-gpu 0.9.20
inference-sdk 0.9.20

x86-gpu(rtx3090)

Minimal Reproducible Example

cog-vlm-client$ python script.py --image "data/tire.jpg" --prompt "read serial number from tire"

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Inference SDK missing requirement when running tests

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

_ ERROR collecting tests/inference_sdk/unit_tests/http/test_client.py _
ImportError while importing test module '/home/perovskite/Development/professional/open-source/roboflow/inference-dev/inference/tests/inference_sdk/unit_tests/http/test_client.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../../mambaforge/envs/inference-dev/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
inference/tests/inference_sdk/unit_tests/http/test_client.py:11: in <module>
    from requests_mock.mocker import Mocker
E   ModuleNotFoundError: No module named 'requests_mock'

_ ERROR collecting tests/inference_sdk/unit_tests/http/utils/test_executors.py _
ImportError while importing test module '/home/perovskite/Development/professional/open-source/roboflow/inference-dev/inference/tests/inference_sdk/unit_tests/http/utils/test_executors.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../../mambaforge/envs/inference-dev/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
inference/tests/inference_sdk/unit_tests/http/utils/test_executors.py:9: in <module>
    from requests_mock import Mocker
E   ModuleNotFoundError: No module named 'requests_mock'

Environment

  • Inference: 0.9.14rc2 (dev install from main)
  • OS: arch linux
  • Device: macbook pro
  • Python: 3.11.8
  • mamba virtual env

Minimal Reproducible Example

I am using a mamba environment with the provided minimal environment file below in the code section. Any virtual environment will work, I'm using mamba as it is one of the tools I use most often.

I wanted to see the state of tests for each of the inference packages in the repo, so I was selectively installing the requirements using pip in my mamba environment with the following command.

# SDK requirements
pip install -r requirements/requirements.sdk.http.txt

After installation completed, I ran tests using the following command. I created an HTML coverage output so I could inspect tests that I might be able to contribute to.

pytest --cov-report html --cov=inference_sdk/ tests/inference_sdk/

The error show above was thrown, indicating that requests-mock was missing in the environment. I'm not sure if each requirement file is supposed to be self contained for running the different packages in the repo, but I did make this assumption and I couldn't easily see in the documentation a spot where it said this was not the case. So, I may have made a terrible assumption...

Nonetheless, I inspected the requirements.sdk.http.txt file and saw that requests-mock was not in the list. After adding it, and rerunning the tests, the tests completed successfully. If each requirements file is supposed to be self contained for a specific package in the repo, then requests-mock is missing as a requirement. If not, then I need to read the documentation more closely to figure out the correct order of operations for installing inference in a development environment.

code

# environment.yaml
name: inference-dev
channels:
  - conda-forge
dependencies:
  - python >3.8,<3.12

  # Dependencies

  # Package managers
  - pip

  # Development dependencies
  - black
  - flake8
  - isort
  - jupyterlab
  - pip:
    - pyre-check

  # Debugging dependencies
  - ipdb
  - pytest
  - pytest-asyncio
  - pytest-cov

  # Documents dependencies
  - mkdocs
  - mkdocstrings
  - mkdocstrings-python

Additional

During my inspection of the requirements.sdk.http.txt file I noticed that requests is listed twice. I figured this out by sorting the requirements.

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

H100 Support

Search before asking

  • I have searched the Inference issues and found no similar feature requests.

Description

Currently the version of CUDA we use in our GPU base images doesn't support the sm_90 compute environment which the H100 needs. I think it needs at least CUDA 11.8 and our base image is 11.7 (FROM nvcr.io/nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu22.04).

Sidenote: Latest is 12.3; may be good to try to get all the way up there if possible while maintaining backwards compatibility to pull in bug fixes & performance improvements.

Use case

People with H100s.

Additional

NVIDIA H100 PCIe with CUDA capability sm_90 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70 sm_75 sm_80 sm_86.
If you want to use the NVIDIA H100 PCIe GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

'TypeError: quote_from_bytes() expected' bytes when loading model using get_roboflow_model

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

I just follow the step in https://github.com/roboflow/inference#single-image-inference

But it rasied an Error in this line
----> 1 model = get_roboflow_model(

Environment

Python 3.10.11
inference==0.9.5

Minimal Reproducible Example

In [1]: from inference.models.utils import get_roboflow_model
   ...: 

In [2]: model = get_roboflow_model(
   ...:     model_id="soccer-players-5fuqs/1"
   ...: )
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[2], line 1
----> 1 model = get_roboflow_model(
      2     model_id="soccer-players-5fuqs/1"
      3 )

File /opt/conda/lib/python3.10/site-packages/inference/models/utils.py:164, in get_roboflow_model(model_id, api_key, **kwargs)
    163 def get_roboflow_model(model_id, api_key=API_KEY, **kwargs):
--> 164     task, model = get_model_type(model_id, api_key=api_key)
    165     return ROBOFLOW_MODEL_TYPES[(task, model)](model_id, api_key=api_key, **kwargs)

File /opt/conda/lib/python3.10/site-packages/inference/core/registries/roboflow.py:80, in get_model_type(model_id, api_key)
     78 if cached_metadata is not None:
     79     return cached_metadata[0], cached_metadata[1]
---> 80 workspace_id = get_roboflow_workspace(api_key=api_key)
     81 project_task_type = get_roboflow_dataset_type(
     82     api_key=api_key, workspace_id=workspace_id, dataset_id=dataset_id
     83 )
     84 if version_id == STUB_VERSION_ID:

File /opt/conda/lib/python3.10/site-packages/inference/core/roboflow_api.py:74, in wrap_roboflow_api_errors.<locals>.decorator.<locals>.wrapper(*args, **kwargs)
     72 def wrapper(*args, **kwargs) -> Any:
     73     try:
---> 74         return function(*args, **kwargs)
     75     except (requests.exceptions.ConnectionError, ConnectionError) as error:
     76         logger.error(f"Could not connect to Roboflow API. Error: {error}")

File /opt/conda/lib/python3.10/site-packages/inference/core/roboflow_api.py:110, in get_roboflow_workspace(api_key)
    108 @wrap_roboflow_api_errors()
    109 def get_roboflow_workspace(api_key: str) -> WorkspaceID:
--> 110     api_url = _add_params_to_url(
    111         url=API_BASE_URL,
    112         params=[("api_key", api_key), ("nocache", "true")],
    113     )
    114     api_key_info = _get_from_url(url=api_url)
    115     workspace_id = api_key_info.get("workspace")

File /opt/conda/lib/python3.10/site-packages/inference/core/roboflow_api.py:389, in _add_params_to_url(url, params)
    387 if len(params) == 0:
    388     return url
--> 389 params_chunks = [
    390     f"{name}={urllib.parse.quote_plus(value)}" for name, value in params
    391 ]
    392 parameters_string = "&".join(params_chunks)
    393 return f"{url}?{parameters_string}"

File /opt/conda/lib/python3.10/site-packages/inference/core/roboflow_api.py:390, in <listcomp>(.0)
    387 if len(params) == 0:
    388     return url
    389 params_chunks = [
--> 390     f"{name}={urllib.parse.quote_plus(value)}" for name, value in params
    391 ]
    392 parameters_string = "&".join(params_chunks)
    393 return f"{url}?{parameters_string}"

File /opt/conda/lib/python3.10/urllib/parse.py:885, in quote_plus(string, safe, encoding, errors)
    883 else:
    884     space = b' '
--> 885 string = quote(string, safe + space, encoding, errors)
    886 return string.replace(' ', '+')

File /opt/conda/lib/python3.10/urllib/parse.py:869, in quote(string, safe, encoding, errors)
    867     if errors is not None:
    868         raise TypeError("quote() doesn't support 'errors' for bytes")
--> 869 return quote_from_bytes(string, safe)

File /opt/conda/lib/python3.10/urllib/parse.py:894, in quote_from_bytes(bs, safe)
    889 """Like quote(), but accepts a bytes object rather than a str, and does
    890 not perform string-to-bytes encoding.  It always returns an ASCII string.
    891 quote_from_bytes(b'abc def\x3f') -> 'abc%20def%3f'
    892 """
    893 if not isinstance(bs, (bytes, bytearray)):
--> 894     raise TypeError("quote_from_bytes() expected bytes")
    895 if not bs:
    896     return ''

TypeError: quote_from_bytes() expected bytes

In [3]: 

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

CLI Should Work Without Docker

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

I installed inference-gpu on a fresh VM (inside a docker container). I want to use the CLI to run the benchmark. But it's complaining that the docker daemon is not running.

inference_cli.lib.exceptions.DockerConnectionErrorException: Error connecting to Docker daemon. Is docker installed and running? See https://www.docker.com/get-started/ for installation instructions.

I understand I'd need that for commands like inference server start but I shouldn't need it to do other things with the CLI.

Environment

[email protected]:/$ pip freeze | grep inference
inference-cli==0.9.15
inference-gpu==0.9.15
inference-sdk==0.9.15
[email protected]:/$ 

pytorch/pytorch:2.2.0-cuda12.1-cudnn8-devel docker with after running pip install inference-gpu

image

Minimal Reproducible Example

pip install inference-gpu
inference

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

NotImplementedError

Search before asking

  • I have searched the Inference issues and found no similar feature requests.

Question

When I was running this code (main/examples/sam-client/app.py), this error occurred, what could be the cause? I set --image_path to "./cat.jpg"
Traceback (most recent call last):
File "/home/z/deeplearning/roboflow/test3.py", line 42, in
inference_results = model.infer(image_path)
File "/home/z/anaconda3/envs/inference1/lib/python3.10/site-packages/inference/core/models/base.py", line 23, in infer
preproc_image, returned_metadata = self.preprocess(image, **kwargs)
File "/home/z/anaconda3/envs/inference1/lib/python3.10/site-packages/inference/core/models/base.py", line 35, in preprocess
raise NotImplementedError
NotImplementedError

Additional

No response

Can add, delete, update stream realtime for only one pipeline has been run before?

Search before asking

  • I have searched the Inference issues and found no similar feature requests.

Question

Hello everyone,
I'm very interested in Roboflow Inference. I'm wondering, with the current InferencePipeline, is it possible to add, edit, and delete the number of inputs for just one pipeline?
For example, AI Model has a max_batch_size of 8
Initially I initialize:
pipeline = InferencePipeline(...) with only one RTSP stream
pipeline.start()

Can I add an RTSP stream to the pipeline running above? For example:
pipeline.add_stream("rtsp://...")
Does adding not affect previously running threads?

Can anyone help me answer if InferencePipeline currently has the ability to do that?
And in your opinion, add_stream to a running pipeline is better than having multiple copies of the pipeline running at the same time?
Thank!

Additional

No response

Same structure for API and library results

Search before asking

  • I have searched the Inference issues and found no similar feature requests.

Description

The API (http) inference and the library (pip install) inference models have different result structures.
It would be neat if they both return results with the structure of the API inference. This way the approaches are exchangeable and, more important, the results of the library inference can be used with supervision, as the API inference results.

Use case

Let's take the quickstart example as usecase.
If you run the examples (ready to run scripts further down below), the following results are returned.

The API inference result:

{
   "time":0.2851218069990864,
   "image":{
      "width":398,
      "height":224
   },
   "predictions":[
      {
         "x":5.5,
         "y":152.0,
         "width":11.0,
         "height":30.0,
         "confidence":0.9074968099594116,
         "class":"player",
         "class_id":1
      },
      {
         "x":145.0,
         "y":96.0,
         "width":14.0,
         "height":24.0,
         "confidence":0.8891444206237793,
         "class":"player",
         "class_id":1
      },
      ...
   ]
}

The library inference result:

[[
[0.0, 137.0, 11.0, 167.0, 0.9075440764427185, 0.8860160708427429, 1.0], 
[138.0, 84.0, 152.0, 108.0, 0.8891727924346924, 0.9700851440429688, 1.0], 
[17.0, 77.0, 33.0, 102.0, 0.8874990940093994, 0.9652542471885681, 1.0], 
[305.0, 162.0, 321.0, 194.0, 0.8796935081481934, 0.9643577337265015, 1.0], 
...
]]

The API result can be easily processed with supervision, while the library result needs a different logic.
For a bounding box the logic is fairly simple but for polygons (instance segmentation) not necessarily. Also, it would be a lot more convenient to have the library results also integrated with supervision.

Please let me know if the library results can be converted into a supervision compatible format. I just couldn't find anything. From the documentation, it was not clear to me how to reformat the instance segmentation results for usage with supervision.

Thanks for the step of open sourcing 'inference'!
If I can help with the implementation, I'm happy to help, but might need some guidance/feedback.

Additional

Examples ready to run

API Example

import requests
import cv2
import supervision as sv
from roboflow import Roboflow
import urllib
import numpy as np

ROBOFLOW_API_KEY = "YOUR_API_KEY"

# Roboflow quickstart example

dataset_id = "soccer-players-5fuqs"
version_id = "1"
image_url = (
    "https://source.roboflow.com/pwYAXv9BTpqLyFfgQoPZ/u48G0UpWfk8giSw7wrU8/original.jpg"
)

api_key = ROBOFLOW_API_KEY
confidence = 0.5

url = f"http://localhost:9001/{dataset_id}/{version_id}"

params = {
    "api_key": api_key,
    "confidence": confidence,
    "image": image_url,
}

res = requests.post(url, params=params)
print(res.json())

# Roboflow visualization with supervision

req = urllib.request.urlopen(image_url)
arr = np.asarray(bytearray(req.read()), dtype=np.uint8)
img = cv2.imdecode(arr, -1)

rf = Roboflow(api_key=api_key)
project = rf.workspace().project("soccer-players-5fuqs")
model = project.version(1).model
annotator = sv.BoxAnnotator()

class_list = ["player", "referee", "football"]
detections = sv.Detections.from_roboflow(res.json(), class_list)
labels = [
    f"{class_list[class_id]} {confidence_value:0.2f}"
    for _, _, confidence_value, class_id, _ in detections
]
annotated_frame = annotator.annotate(
    scene=img.copy(), detections=detections, labels=labels
)
cv2.imwrite("frame.jpg", img)
cv2.imwrite("annotated_frame.jpg", annotated_frame)

Library Example

from inference.models.utils import get_roboflow_model

ROBOFLOW_API_KEY = "YOUR_API_KEY"

# Roboflow quickstart example

model = get_roboflow_model(
    model_id="soccer-players-5fuqs/1",
    # Replace ROBOFLOW_API_KEY with your Roboflow API Key
    api_key=ROBOFLOW_API_KEY,
)

results = model.infer(
    image="https://source.roboflow.com/pwYAXv9BTpqLyFfgQoPZ/u48G0UpWfk8giSw7wrU8/original.jpg",
    confidence=0.5,
    iou_threshold=0.5,
)

print(results)

# Roboflow visualization with supervision

# Here a custom logic will be needed for visualizing the results.
# Bboxes can be done fairly easy and the format can be inferred from the result itself, but not necessarily for polygons / instance segmentation

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

How can I get predicted label and the coordinates of the detection bbox ?

Search before asking

  • I have searched the Inference issues and found no similar feature requests.

Question

I reference this blog to build and run the docker image in Jetson. Then I reference this repo to implement webcam inference. It can run successfully.
But requests.post() function simply returns an image that draws the bboxes. How can I get predicted label and the coordinates of the detection bbox ?

Additional

No response

Poetry-installing `inference` with `roboflow` takes 26 - 38 minutes.

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

Starting with an empty project, poetry, python 3.10 environment, I ran:

poetry init -n
poetry shell
poetry add notebook
poetry add roboflow
poetry add inference

This was enough to make dependency resolution last 2319.0s.

Subsequently run of poetry add tqdm took 213.2s, following which I got "No dependencies to install or update".

Adding ipywidgets took another 220.5s.


Whether it's an issue with inference, poetry or roboflow or their dependencies, the end result is a very miserable dev experience.

Environment

  • Inference 0.9.14

  • Roboflow 1.1.20

  • Ubuntu 22.04.4 LTS

  • Alienware 15 r3

  • Python 3.10.12

  • Pip 23.3.2

  • Poetry 1.3.1

Minimal Reproducible Example

poetry init -n
poetry shell
poetry add roboflow
poetry add inference
# Took 1578.6s

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Run Multiple Models all together.

Search before asking

  • I have searched the Inference issues and found no similar feature requests.

Question

Hi, how can I run multiple models together in following code? The model are public models on roboflow, not created by me.

Additional

No response

yolov8-cls outputs differ

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

I could not reproduce ultralytics behaviour on exported onnx model - seems like treating the model as multi-class leads to applying softmax at already softmaxed predictions + I am getting miss predictions even if this additional softmax is removed
tested against this image: https://3.bp.blogspot.com/-W__wiaHUjwI/Vt3Grd8df0I/AAAAAAAAA78/7xqUNj8ujtY/s1600/image02.png

Environment

No response

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

inference --version

Search before asking

  • I have searched the Inference issues and found no similar feature requests.

Description

Would be great if inference --version told you what version you had installed.

Use case

I'm in a remote env and want to know what I'm working with.

Additional

Currently:

[email protected]:~$ inference --version
Usage: inference [OPTIONS] COMMAND [ARGS]...
Try 'inference --help' for help.
โ•ญโ”€ Error โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ No such option: --version                                                                                                                                                                                                                                                  โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
[email protected]:~$

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Video and webcam inference

Hello,

I want to know how to use the open-source inference server to inference on video inputs and webcam inputs.

I saw there is a repo for video inference here:
https://github.com/roboflow/inference-client

However, that repo is only suited if you are running the inference server via Docker.

So how can we do video and webcam inputs after installing the inference server via pip?

inference infer should warn that it needs the Docker running

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

I tried to run inference via the CLI & it looks like it requires me to have the Docker running (vs using the pip package or hitting the Hosted API). The error message is extremely long and nonobvious.

Environment

[email protected]:/$ pip freeze | grep inference
inference-cli==0.9.15
inference-gpu==0.9.15
inference-sdk==0.9.15
[email protected]:/$ 

pytorch/pytorch:2.2.0-cuda12.1-cudnn8-devel docker with after running pip install inference-gpu

image

Minimal Reproducible Example

(snipped some of the error output for brevity since Github complained that There was an error creating your Issue: body is too long (maximum is 65536 characters).)

[email protected]:/$ inference infer -i "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Flower_poster_2.jpg/660px-Flower_poster_2.jpg" -m "yolov8n-640"
Running inference on https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Flower_poster_2.jpg/660px-Flower_poster_2.jpg, using model: yolov8n-640, and host: http://localhost:9001
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Traceback (most recent call last) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ /opt/conda/lib/python3.10/site-packages/urllib3/connection.py:174 in _new_conn                   โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   171 โ”‚   โ”‚   โ”‚   extra_kw["socket_options"] = self.socket_options                               โ”‚
โ”‚   172 โ”‚   โ”‚                                                                                      โ”‚
โ”‚   173 โ”‚   โ”‚   try:                                                                               โ”‚
โ”‚ โฑ 174 โ”‚   โ”‚   โ”‚   conn = connection.create_connection(                                           โ”‚
โ”‚   175 โ”‚   โ”‚   โ”‚   โ”‚   (self._dns_host, self.port), self.timeout, **extra_kw                      โ”‚
โ”‚   176 โ”‚   โ”‚   โ”‚   )                                                                              โ”‚
โ”‚   177                                                                                            โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ                      โ”‚
โ”‚ โ”‚ extra_kw = {'socket_options': [(6, 1, 1)]}                              โ”‚                      โ”‚
โ”‚ โ”‚     self = <urllib3.connection.HTTPConnection object at 0x7f1e1023a350> โ”‚                      โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ                      โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/urllib3/util/connection.py:95 in create_connection       โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    92 โ”‚   โ”‚   โ”‚   โ”‚   sock = None                                                                โ”‚
โ”‚    93 โ”‚                                                                                          โ”‚
โ”‚    94 โ”‚   if err is not None:                                                                    โ”‚
โ”‚ โฑ  95 โ”‚   โ”‚   raise err                                                                          โ”‚
โ”‚    96 โ”‚                                                                                          โ”‚
โ”‚    97 โ”‚   raise socket.error("getaddrinfo returns an empty list")                                โ”‚
โ”‚    98                                                                                            โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ                           โ”‚
โ”‚ โ”‚        address = ('localhost', 9001)                               โ”‚                           โ”‚
โ”‚ โ”‚             af = <AddressFamily.AF_INET: 2>                        โ”‚                           โ”‚
โ”‚ โ”‚      canonname = ''                                                โ”‚                           โ”‚
โ”‚ โ”‚            err = ConnectionRefusedError(111, 'Connection refused') โ”‚                           โ”‚
โ”‚ โ”‚         family = <AddressFamily.AF_INET: 2>                        โ”‚                           โ”‚
โ”‚ โ”‚           host = 'localhost'                                       โ”‚                           โ”‚
โ”‚ โ”‚           port = 9001                                              โ”‚                           โ”‚
โ”‚ โ”‚          proto = 6                                                 โ”‚                           โ”‚
โ”‚ โ”‚            res = (                                                 โ”‚                           โ”‚
โ”‚ โ”‚                  โ”‚   <AddressFamily.AF_INET: 2>,                   โ”‚                           โ”‚
โ”‚ โ”‚                  โ”‚   <SocketKind.SOCK_STREAM: 1>,                  โ”‚                           โ”‚
โ”‚ โ”‚                  โ”‚   6,                                            โ”‚                           โ”‚
โ”‚ โ”‚                  โ”‚   '',                                           โ”‚                           โ”‚
โ”‚ โ”‚                  โ”‚   ('127.0.0.1', 9001)                           โ”‚                           โ”‚
โ”‚ โ”‚                  )                                                 โ”‚                           โ”‚
โ”‚ โ”‚             sa = ('127.0.0.1', 9001)                               โ”‚                           โ”‚
โ”‚ โ”‚           sock = None                                              โ”‚                           โ”‚
โ”‚ โ”‚ socket_options = [(6, 1, 1)]                                       โ”‚                           โ”‚
โ”‚ โ”‚       socktype = <SocketKind.SOCK_STREAM: 1>                       โ”‚                           โ”‚
โ”‚ โ”‚ source_address = None                                              โ”‚                           โ”‚
โ”‚ โ”‚        timeout = None                                              โ”‚                           โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ                           โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/urllib3/util/connection.py:85 in create_connection       โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    82 โ”‚   โ”‚   โ”‚   โ”‚   sock.settimeout(timeout)                                                   โ”‚
โ”‚    83 โ”‚   โ”‚   โ”‚   if source_address:                                                             โ”‚
โ”‚    84 โ”‚   โ”‚   โ”‚   โ”‚   sock.bind(source_address)                                                  โ”‚
โ”‚ โฑ  85 โ”‚   โ”‚   โ”‚   sock.connect(sa)                                                               โ”‚
โ”‚    86 โ”‚   โ”‚   โ”‚   return sock                                                                    โ”‚
โ”‚    87 โ”‚   โ”‚                                                                                      โ”‚
โ”‚    88 โ”‚   โ”‚   except socket.error as e:                                                          โ”‚
โ”‚                                                                                                  โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Traceback (most recent call last) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ /opt/conda/lib/python3.10/site-packages/urllib3/connectionpool.py:715 in urlopen                 โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    712 โ”‚   โ”‚   โ”‚   โ”‚   self._prepare_proxy(conn)                                                 โ”‚
โ”‚    713 โ”‚   โ”‚   โ”‚                                                                                 โ”‚
โ”‚    714 โ”‚   โ”‚   โ”‚   # Make the request on the httplib connection object.                          โ”‚
โ”‚ โฑ  715 โ”‚   โ”‚   โ”‚   httplib_response = self._make_request(                                        โ”‚
โ”‚    716 โ”‚   โ”‚   โ”‚   โ”‚   conn,                                                                     โ”‚
โ”‚    717 โ”‚   โ”‚   โ”‚   โ”‚   method,                                                                   โ”‚
โ”‚    718 โ”‚   โ”‚   โ”‚   โ”‚   url,                                                                      โ”‚
โ”‚                                                                                                  โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/urllib3/connectionpool.py:416 in _make_request           โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    413 โ”‚   โ”‚   โ”‚   if chunked:                                                                   โ”‚
โ”‚    414 โ”‚   โ”‚   โ”‚   โ”‚   conn.request_chunked(method, url, **httplib_request_kw)                   โ”‚
โ”‚    415 โ”‚   โ”‚   โ”‚   else:                                                                         โ”‚
โ”‚ โฑ  416 โ”‚   โ”‚   โ”‚   โ”‚   conn.request(method, url, **httplib_request_kw)                           โ”‚
โ”‚    417 โ”‚   โ”‚                                                                                     โ”‚
โ”‚    418 โ”‚   โ”‚   # We are swallowing BrokenPipeError (errno.EPIPE) since the server is             โ”‚
โ”‚    419 โ”‚   โ”‚   # legitimately able to close the connection after sending a valid response.       โ”‚
โ”‚                                                                                                  โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/urllib3/connection.py:244 in request                     โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   241 โ”‚   โ”‚   โ”‚   headers = headers.copy()                                                       โ”‚
โ”‚   242 โ”‚   โ”‚   if "user-agent" not in (six.ensure_str(k.lower()) for k in headers):               โ”‚
โ”‚   243 โ”‚   โ”‚   โ”‚   headers["User-Agent"] = _get_default_user_agent()                              โ”‚
โ”‚ โฑ 244 โ”‚   โ”‚   super(HTTPConnection, self).request(method, url, body=body, headers=headers)       โ”‚
โ”‚   245 โ”‚                                                                                          โ”‚
โ”‚   246 โ”‚   def request_chunked(self, method, url, body=None, headers=None):                       โ”‚
โ”‚   247 โ”‚   โ”‚   """                                                                                โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/http/client.py:1283 in request                                         โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   1280 โ”‚   def request(self, method, url, body=None, headers={}, *,                              โ”‚
โ”‚   1281 โ”‚   โ”‚   โ”‚   โ”‚   encode_chunked=False):                                                    โ”‚
โ”‚   1282 โ”‚   โ”‚   """Send a complete request to the server."""                                      โ”‚
โ”‚ โฑ 1283 โ”‚   โ”‚   self._send_request(method, url, body, headers, encode_chunked)                    โ”‚
โ”‚   1284 โ”‚                                                                                         โ”‚
โ”‚   1285 โ”‚   def _send_request(self, method, url, body, headers, encode_chunked):                  โ”‚
โ”‚   1286 โ”‚   โ”‚   # Honor explicitly requested Host: and Accept-Encoding: headers.                  โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/http/client.py:1329 in _send_request                                   โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   1326 โ”‚   โ”‚   โ”‚   # RFC 2616 Section 3.7.1 says that text default has a                         โ”‚
โ”‚   1327 โ”‚   โ”‚   โ”‚   # default charset of iso-8859-1.                                              โ”‚
โ”‚   1328 โ”‚   โ”‚   โ”‚   body = _encode(body, 'body')                                                  โ”‚
โ”‚ โฑ 1329 โ”‚   โ”‚   self.endheaders(body, encode_chunked=encode_chunked)                              โ”‚
โ”‚   1330 โ”‚                                                                                         โ”‚
โ”‚   1331 โ”‚   def getresponse(self):                                                                โ”‚
โ”‚   1332 โ”‚   โ”‚   """Get the response from the server.                                              โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/http/client.py:1278 in endheaders                                      โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   1275 โ”‚   โ”‚   โ”‚   self.__state = _CS_REQ_SENT                                                   โ”‚
โ”‚   1276 โ”‚   โ”‚   else:                                                                             โ”‚
โ”‚   1277 โ”‚   โ”‚   โ”‚   raise CannotSendHeader()                                                      โ”‚
โ”‚ โฑ 1278 โ”‚   โ”‚   self._send_output(message_body, encode_chunked=encode_chunked)                    โ”‚
โ”‚   1279 โ”‚                                                                                         โ”‚
โ”‚   1280 โ”‚   def request(self, method, url, body=None, headers={}, *,                              โ”‚
โ”‚   1281 โ”‚   โ”‚   โ”‚   โ”‚   encode_chunked=False):                                                    โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/http/client.py:1038 in _send_output                                    โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   1035 โ”‚   โ”‚   self._buffer.extend((b"", b""))                                                   โ”‚
โ”‚   1036 โ”‚   โ”‚   msg = b"\r\n".join(self._buffer)                                                  โ”‚
โ”‚   1037 โ”‚   โ”‚   del self._buffer[:]                                                               โ”‚
โ”‚ โฑ 1038 โ”‚   โ”‚   self.send(msg)                                                                    โ”‚
โ”‚   1039 โ”‚   โ”‚                                                                                     โ”‚
โ”‚   1040 โ”‚   โ”‚   if message_body is not None:                                                      โ”‚
โ”‚   1041                                                                                           โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/http/client.py:976 in send                                             โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    973 โ”‚   โ”‚                                                                                     โ”‚
โ”‚    974 โ”‚   โ”‚   if self.sock is None:                                                             โ”‚
โ”‚    975 โ”‚   โ”‚   โ”‚   if self.auto_open:                                                            โ”‚
โ”‚ โฑ  976 โ”‚   โ”‚   โ”‚   โ”‚   self.connect()                                                            โ”‚
โ”‚    977 โ”‚   โ”‚   โ”‚   else:                                                                         โ”‚
โ”‚    978 โ”‚   โ”‚   โ”‚   โ”‚   raise NotConnected()                                                      โ”‚
โ”‚    979                                                                                           โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/urllib3/connection.py:205 in connect                     โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   202 โ”‚   โ”‚   โ”‚   self.auto_open = 0                                                             โ”‚
โ”‚   203 โ”‚                                                                                          โ”‚
โ”‚   204 โ”‚   def connect(self):                                                                     โ”‚
โ”‚ โฑ 205 โ”‚   โ”‚   conn = self._new_conn()                                                            โ”‚
โ”‚   206 โ”‚   โ”‚   self._prepare_conn(conn)                                                           โ”‚
โ”‚   207 โ”‚                                                                                          โ”‚
โ”‚   208 โ”‚   def putrequest(self, method, url, *args, **kwargs):                                    โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ                          โ”‚
โ”‚ โ”‚ self = <urllib3.connection.HTTPConnection object at 0x7f1e1023a350> โ”‚                          โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ                          โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/urllib3/connection.py:186 in _new_conn                   โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   183 โ”‚   โ”‚   โ”‚   )                                                                              โ”‚
โ”‚   184 โ”‚   โ”‚                                                                                      โ”‚
โ”‚   185 โ”‚   โ”‚   except SocketError as e:                                                           โ”‚
โ”‚ โฑ 186 โ”‚   โ”‚   โ”‚   raise NewConnectionError(                                                      โ”‚
โ”‚   187 โ”‚   โ”‚   โ”‚   โ”‚   self, "Failed to establish a new connection: %s" % e                       โ”‚
โ”‚   188 โ”‚   โ”‚   โ”‚   )                                                                              โ”‚
โ”‚   189                                                                                            โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ                      โ”‚
โ”‚ โ”‚ extra_kw = {'socket_options': [(6, 1, 1)]}                              โ”‚                      โ”‚
โ”‚ โ”‚     self = <urllib3.connection.HTTPConnection object at 0x7f1e1023a350> โ”‚                      โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ                      โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f1e1023a350>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Traceback (most recent call last) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ /opt/conda/lib/python3.10/site-packages/requests/adapters.py:486 in send                         โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   483 โ”‚   โ”‚   โ”‚   timeout = TimeoutSauce(connect=timeout, read=timeout)                          โ”‚
โ”‚   484 โ”‚   โ”‚                                                                                      โ”‚
โ”‚   485 โ”‚   โ”‚   try:                                                                               โ”‚
โ”‚ โฑ 486 โ”‚   โ”‚   โ”‚   resp = conn.urlopen(                                                           โ”‚
โ”‚   487 โ”‚   โ”‚   โ”‚   โ”‚   method=request.method,                                                     โ”‚
โ”‚   488 โ”‚   โ”‚   โ”‚   โ”‚   url=url,                                                                   โ”‚
โ”‚   489 โ”‚   โ”‚   โ”‚   โ”‚   body=request.body,                                                         โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ               โ”‚
โ”‚ โ”‚    cert = None                                                                 โ”‚               โ”‚
โ”‚ โ”‚ chunked = False                                                                โ”‚               โ”‚
โ”‚ โ”‚    conn = <urllib3.connectionpool.HTTPConnectionPool object at 0x7f1e10239f00> โ”‚               โ”‚
โ”‚ โ”‚ proxies = OrderedDict()                                                        โ”‚               โ”‚
โ”‚ โ”‚ request = <PreparedRequest [GET]>                                              โ”‚               โ”‚
โ”‚ โ”‚    self = <requests.adapters.HTTPAdapter object at 0x7f1e10239de0>             โ”‚               โ”‚
โ”‚ โ”‚  stream = False                                                                โ”‚               โ”‚
โ”‚ โ”‚ timeout = Timeout(connect=None, read=None, total=None)                         โ”‚               โ”‚
โ”‚ โ”‚     url = '/model/registry'                                                    โ”‚               โ”‚
โ”‚ โ”‚  verify = True                                                                 โ”‚               โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ               โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/urllib3/connectionpool.py:799 in urlopen                 โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    796 โ”‚   โ”‚   โ”‚   elif isinstance(e, (SocketError, HTTPException)):                             โ”‚
โ”‚    797 โ”‚   โ”‚   โ”‚   โ”‚   e = ProtocolError("Connection aborted.", e)                               โ”‚
โ”‚    798 โ”‚   โ”‚   โ”‚                                                                                 โ”‚
โ”‚ โฑ  799 โ”‚   โ”‚   โ”‚   retries = retries.increment(                                                  โ”‚
โ”‚    800 โ”‚   โ”‚   โ”‚   โ”‚   method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]           โ”‚
โ”‚    801 โ”‚   โ”‚   โ”‚   )                                                                             โ”‚
โ”‚    802 โ”‚   โ”‚   โ”‚   retries.sleep()                                                               โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚ _is_ssl_error_message_from_http_proxy = <function                                            โ”‚ โ”‚
โ”‚ โ”‚                                         HTTPConnectionPool.urlopen.<locals>._is_ssl_error_mโ€ฆ โ”‚ โ”‚
โ”‚ โ”‚                                         at 0x7f1e10227130>                                   โ”‚ โ”‚
โ”‚ โ”‚                      assert_same_host = False                                                โ”‚ โ”‚
โ”‚ โ”‚                                  body = None                                                 โ”‚ โ”‚
โ”‚ โ”‚                              body_pos = None                                                 โ”‚ โ”‚
โ”‚ โ”‚                               chunked = False                                                โ”‚ โ”‚
โ”‚ โ”‚                            clean_exit = False                                                โ”‚ โ”‚
โ”‚ โ”‚                                  conn = None                                                 โ”‚ โ”‚
โ”‚ โ”‚                    destination_scheme = None                                                 โ”‚ โ”‚
โ”‚ โ”‚                                   err = None                                                 โ”‚ โ”‚
โ”‚ โ”‚                               headers = {'User-Agent': 'python-requests/2.31.0',             โ”‚ โ”‚
โ”‚ โ”‚                                         'Accept-Encoding': 'gzip, deflate, br', 'Accept':    โ”‚ โ”‚
โ”‚ โ”‚                                         '*/*', 'Connection': 'keep-alive'}                   โ”‚ โ”‚
โ”‚ โ”‚                  http_tunnel_required = False                                                โ”‚ โ”‚
โ”‚ โ”‚                     is_new_proxy_conn = False                                                โ”‚ โ”‚
โ”‚ โ”‚                                method = 'GET'                                                โ”‚ โ”‚
โ”‚ โ”‚                            parsed_url = Url(                                                 โ”‚ โ”‚
โ”‚ โ”‚                                         โ”‚   scheme=None,                                     โ”‚ โ”‚
โ”‚ โ”‚                                         โ”‚   auth=None,                                       โ”‚ โ”‚
โ”‚ โ”‚                                         โ”‚   host=None,                                       โ”‚ โ”‚
โ”‚ โ”‚                                         โ”‚   port=None,                                       โ”‚ โ”‚
โ”‚ โ”‚                                         โ”‚   path='/model/registry',                          โ”‚ โ”‚
โ”‚ โ”‚                                         โ”‚   query=None,                                      โ”‚ โ”‚
โ”‚ โ”‚                                         โ”‚   fragment=None                                    โ”‚ โ”‚
โ”‚ โ”‚                                         )                                                    โ”‚ โ”‚
โ”‚ โ”‚                          pool_timeout = None                                                 โ”‚ โ”‚
โ”‚ โ”‚                              redirect = False                                                โ”‚ โ”‚
โ”‚ โ”‚                          release_conn = False                                                โ”‚ โ”‚
โ”‚ โ”‚                     release_this_conn = True                                                 โ”‚ โ”‚
โ”‚ โ”‚                           response_kw = {'preload_content': False, 'decode_content': False}  โ”‚ โ”‚
โ”‚ โ”‚                               retries = Retry(total=0, connect=None, read=False,             โ”‚ โ”‚
โ”‚ โ”‚                                         redirect=None, status=None)                          โ”‚ โ”‚
โ”‚ โ”‚                                  self = <urllib3.connectionpool.HTTPConnectionPool object at โ”‚ โ”‚
โ”‚ โ”‚                                         0x7f1e10239f00>                                      โ”‚ โ”‚
โ”‚ โ”‚                               timeout = Timeout(connect=None, read=None, total=None)         โ”‚ โ”‚
โ”‚ โ”‚                           timeout_obj = Timeout(connect=None, read=None, total=None)         โ”‚ โ”‚
โ”‚ โ”‚                                   url = '/model/registry'                                    โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/urllib3/util/retry.py:592 in increment                   โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   589 โ”‚   โ”‚   )                                                                                  โ”‚
โ”‚   590 โ”‚   โ”‚                                                                                      โ”‚
โ”‚   591 โ”‚   โ”‚   if new_retry.is_exhausted():                                                       โ”‚
โ”‚ โฑ 592 โ”‚   โ”‚   โ”‚   raise MaxRetryError(_pool, url, error or ResponseError(cause))                 โ”‚
โ”‚   593 โ”‚   โ”‚                                                                                      โ”‚
โ”‚   594 โ”‚   โ”‚   log.debug("Incremented Retry for (url='%s'): %r", url, new_retry)                  โ”‚
โ”‚   595                                                                                            โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚             _pool = <urllib3.connectionpool.HTTPConnectionPool object at 0x7f1e10239f00>     โ”‚ โ”‚
โ”‚ โ”‚       _stacktrace = <traceback object at 0x7f1e105cde40>                                     โ”‚ โ”‚
โ”‚ โ”‚             cause = 'unknown'                                                                โ”‚ โ”‚
โ”‚ โ”‚           connect = None                                                                     โ”‚ โ”‚
โ”‚ โ”‚             error = NewConnectionError('<urllib3.connection.HTTPConnection object at         โ”‚ โ”‚
โ”‚ โ”‚                     0x7f1e1023a350>: Failed to establish a new connection: [Errno 111]       โ”‚ โ”‚
โ”‚ โ”‚                     Connection refused')                                                     โ”‚ โ”‚
โ”‚ โ”‚           history = (                                                                        โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   RequestHistory(                                                      โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   method='GET',                                                    โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   url='/model/registry',                                           โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   error=NewConnectionError('<urllib3.connection.HTTPConnection     โ”‚ โ”‚
โ”‚ โ”‚                     object at 0x7f1e1023a350>: Failed to establish a new connection: [Errno  โ”‚ โ”‚
โ”‚ โ”‚                     111] Connection refused'),                                               โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   status=None,                                                     โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   โ”‚   redirect_location=None                                           โ”‚ โ”‚
โ”‚ โ”‚                     โ”‚   ),                                                                   โ”‚ โ”‚
โ”‚ โ”‚                     )                                                                        โ”‚ โ”‚
โ”‚ โ”‚            method = 'GET'                                                                    โ”‚ โ”‚
โ”‚ โ”‚         new_retry = Retry(total=-1, connect=None, read=False, redirect=None, status=None)    โ”‚ โ”‚
โ”‚ โ”‚             other = None                                                                     โ”‚ โ”‚
โ”‚ โ”‚              read = False                                                                    โ”‚ โ”‚
โ”‚ โ”‚          redirect = None                                                                     โ”‚ โ”‚
โ”‚ โ”‚ redirect_location = None                                                                     โ”‚ โ”‚
โ”‚ โ”‚          response = None                                                                     โ”‚ โ”‚
โ”‚ โ”‚              self = Retry(total=0, connect=None, read=False, redirect=None, status=None)     โ”‚ โ”‚
โ”‚ โ”‚            status = None                                                                     โ”‚ โ”‚
โ”‚ โ”‚      status_count = None                                                                     โ”‚ โ”‚
โ”‚ โ”‚             total = -1                                                                       โ”‚ โ”‚
โ”‚ โ”‚               url = '/model/registry'                                                        โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
MaxRetryError: HTTPConnectionPool(host='localhost', port=9001): Max retries exceeded with url: /model/registry (Caused by 
NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1e1023a350>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Traceback (most recent call last) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ /opt/conda/lib/python3.10/site-packages/inference_cli/main.py:89 in infer                        โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    86 โ”‚   typer.echo(                                                                            โ”‚
โ”‚    87 โ”‚   โ”‚   f"Running inference on {input_reference}, using model: {model_id}, and host: {ho   โ”‚
โ”‚    88 โ”‚   )                                                                                      โ”‚
โ”‚ โฑ  89 โ”‚   inference_cli.lib.infer(                                                               โ”‚
โ”‚    90 โ”‚   โ”‚   input_reference=input_reference,                                                   โ”‚
โ”‚    91 โ”‚   โ”‚   model_id=model_id,                                                                 โ”‚
โ”‚    92 โ”‚   โ”‚   api_key=api_key,                                                                   โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚              api_key = None                                                                  โ”‚ โ”‚
โ”‚ โ”‚              display = False                                                                 โ”‚ โ”‚
โ”‚ โ”‚                 host = 'http://localhost:9001'                                               โ”‚ โ”‚
โ”‚ โ”‚      input_reference = 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Flower_poโ€ฆ โ”‚ โ”‚
โ”‚ โ”‚         model_config = None                                                                  โ”‚ โ”‚
โ”‚ โ”‚             model_id = 'yolov8n-640'                                                         โ”‚ โ”‚
โ”‚ โ”‚      output_location = None                                                                  โ”‚ โ”‚
โ”‚ โ”‚ visualisation_config = None                                                                  โ”‚ โ”‚
โ”‚ โ”‚            visualise = True                                                                  โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/inference_cli/lib/infer_adapter.py:120 in infer          โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   117 โ”‚   โ”‚   โ”‚   model_configuration=model_configuration,                                       โ”‚
โ”‚   118 โ”‚   โ”‚   )                                                                                  โ”‚
โ”‚   119 โ”‚   โ”‚   return None                                                                        โ”‚
โ”‚ โฑ 120 โ”‚   infer_on_image(                                                                        โ”‚
โ”‚   121 โ”‚   โ”‚   input_reference=input_reference,                                                   โ”‚
โ”‚   122 โ”‚   โ”‚   model_id=model_id,                                                                 โ”‚
โ”‚   123 โ”‚   โ”‚   api_key=api_key,                                                                   โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚              api_key = None                                                                  โ”‚ โ”‚
โ”‚ โ”‚              display = False                                                                 โ”‚ โ”‚
โ”‚ โ”‚                 host = 'http://localhost:9001'                                               โ”‚ โ”‚
โ”‚ โ”‚      input_reference = 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Flower_poโ€ฆ โ”‚ โ”‚
โ”‚ โ”‚  model_configuration = None                                                                  โ”‚ โ”‚
โ”‚ โ”‚             model_id = 'yolov8n-640'                                                         โ”‚ โ”‚
โ”‚ โ”‚      output_location = None                                                                  โ”‚ โ”‚
โ”‚ โ”‚ visualisation_config = None                                                                  โ”‚ โ”‚
โ”‚ โ”‚            visualise = True                                                                  โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/inference_cli/lib/infer_adapter.py:280 in infer_on_image โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   277 โ”‚   โ”‚   on_frame_visualise = build_visualisation_callback(                                 โ”‚
โ”‚   278 โ”‚   โ”‚   โ”‚   visualisation_config=visualisation_config,                                     โ”‚
โ”‚   279 โ”‚   โ”‚   )                                                                                  โ”‚
โ”‚ โฑ 280 โ”‚   prediction = client.infer(inference_input=input_reference, model_id=model_id)          โ”‚
โ”‚   281 โ”‚   visualised = None                                                                      โ”‚
โ”‚   282 โ”‚   if visualise:                                                                          โ”‚
โ”‚   283 โ”‚   โ”‚   frame_base64 = load_image_from_string(reference=input_reference)[0]                โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚              api_key = None                                                                  โ”‚ โ”‚
โ”‚ โ”‚               client = <inference_sdk.http.client.InferenceHTTPClient object at              โ”‚ โ”‚
โ”‚ โ”‚                        0x7f1e10239ae0>                                                       โ”‚ โ”‚
โ”‚ โ”‚              display = False                                                                 โ”‚ โ”‚
โ”‚ โ”‚                 host = 'http://localhost:9001'                                               โ”‚ โ”‚
โ”‚ โ”‚      input_reference = 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Flower_poโ€ฆ โ”‚ โ”‚
โ”‚ โ”‚  model_configuration = None                                                                  โ”‚ โ”‚
โ”‚ โ”‚             model_id = 'yolov8n-640'                                                         โ”‚ โ”‚
โ”‚ โ”‚   on_frame_visualise = functools.partial(<function create_visualisation at 0x7f1e104128c0>,  โ”‚ โ”‚
โ”‚ โ”‚                        annotators=[<supervision.annotators.core.BoundingBoxAnnotator object  โ”‚ โ”‚
โ”‚ โ”‚                        at 0x7f1e10239a80>], tracker=None)                                    โ”‚ โ”‚
โ”‚ โ”‚      output_location = None                                                                  โ”‚ โ”‚
โ”‚ โ”‚ visualisation_config = None                                                                  โ”‚ โ”‚
โ”‚ โ”‚            visualise = True                                                                  โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/inference_sdk/http/client.py:81 in decorate              โ”‚
โ”‚                                                                                                  โ”‚
โ”‚     78 def wrap_errors(function: callable) -> callable:                                          โ”‚
โ”‚     79 โ”‚   def decorate(*args, **kwargs) -> Any:                                                 โ”‚
โ”‚     80 โ”‚   โ”‚   try:                                                                              โ”‚
โ”‚ โฑ   81 โ”‚   โ”‚   โ”‚   return function(*args, **kwargs)                                              โ”‚
โ”‚     82 โ”‚   โ”‚   except HTTPError as error:                                                        โ”‚
โ”‚     83 โ”‚   โ”‚   โ”‚   if "application/json" in error.response.headers.get("Content-Type", ""):      โ”‚
โ”‚     84 โ”‚   โ”‚   โ”‚   โ”‚   api_message = error.response.json().get("message")                        โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚     args = (<inference_sdk.http.client.InferenceHTTPClient object at 0x7f1e10239ae0>,)       โ”‚ โ”‚
โ”‚ โ”‚ function = <function InferenceHTTPClient.infer at 0x7f1e10410040>                            โ”‚ โ”‚
โ”‚ โ”‚   kwargs = {                                                                                 โ”‚ โ”‚
โ”‚ โ”‚            โ”‚   'inference_input':                                                            โ”‚ โ”‚
โ”‚ โ”‚            'https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Flower_poster_2.jpg/6โ€ฆ โ”‚ โ”‚
โ”‚ โ”‚            โ”‚   'model_id': 'yolov8n-640'                                                     โ”‚ โ”‚
โ”‚ โ”‚            }                                                                                 โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/inference_sdk/http/client.py:231 in infer                โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    228 โ”‚   โ”‚   โ”‚   โ”‚   inference_input=inference_input,                                          โ”‚
โ”‚    229 โ”‚   โ”‚   โ”‚   โ”‚   model_id=model_id,                                                        โ”‚
โ”‚    230 โ”‚   โ”‚   โ”‚   )                                                                             โ”‚
โ”‚ โฑ  231 โ”‚   โ”‚   return self.infer_from_api_v1(                                                    โ”‚
โ”‚    232 โ”‚   โ”‚   โ”‚   inference_input=inference_input,                                              โ”‚
โ”‚    233 โ”‚   โ”‚   โ”‚   model_id=model_id,                                                            โ”‚
โ”‚    234 โ”‚   โ”‚   )                                                                                 โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚ inference_input = 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Flower_poster_โ€ฆ โ”‚ โ”‚
โ”‚ โ”‚        model_id = 'yolov8n-640'                                                              โ”‚ โ”‚
โ”‚ โ”‚            self = <inference_sdk.http.client.InferenceHTTPClient object at 0x7f1e10239ae0>   โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/inference_sdk/http/client.py:379 in infer_from_api_v1    โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    376 โ”‚   โ”‚   model_id_to_be_used = model_id or self.__selected_model                           โ”‚
โ”‚    377 โ”‚   โ”‚   _ensure_model_is_selected(model_id=model_id_to_be_used)                           โ”‚
โ”‚    378 โ”‚   โ”‚   model_id_to_be_used = resolve_roboflow_model_alias(model_id=model_id_to_be_used)  โ”‚
โ”‚ โฑ  379 โ”‚   โ”‚   model_description = self.get_model_description(model_id=model_id_to_be_used)      โ”‚
โ”‚    380 โ”‚   โ”‚   max_height, max_width = _determine_client_downsizing_parameters(                  โ”‚
โ”‚    381 โ”‚   โ”‚   โ”‚   client_downsizing_disabled=self.__inference_configuration.client_downsizing_  โ”‚
โ”‚    382 โ”‚   โ”‚   โ”‚   model_description=model_description,                                          โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚     inference_input = 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Flower_posโ€ฆ โ”‚ โ”‚
โ”‚ โ”‚            model_id = 'yolov8n-640'                                                          โ”‚ โ”‚
โ”‚ โ”‚ model_id_to_be_used = 'coco/3'                                                               โ”‚ โ”‚
โ”‚ โ”‚                self = <inference_sdk.http.client.InferenceHTTPClient object at               โ”‚ โ”‚
โ”‚ โ”‚                       0x7f1e10239ae0>                                                        โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/inference_sdk/http/client.py:518 in                      โ”‚
โ”‚ get_model_description                                                                            โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    515 โ”‚   ) -> ModelDescription:                                                                โ”‚
โ”‚    516 โ”‚   โ”‚   self.__ensure_v1_client_mode()                                                    โ”‚
โ”‚    517 โ”‚   โ”‚   de_aliased_model_id = resolve_roboflow_model_alias(model_id=model_id)             โ”‚
โ”‚ โฑ  518 โ”‚   โ”‚   registered_models = self.list_loaded_models()                                     โ”‚
โ”‚    519 โ”‚   โ”‚   matching_model = filter_model_descriptions(                                       โ”‚
โ”‚    520 โ”‚   โ”‚   โ”‚   descriptions=registered_models.models,                                        โ”‚
โ”‚    521 โ”‚   โ”‚   โ”‚   model_id=de_aliased_model_id,                                                 โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚       allow_loading = True                                                                   โ”‚ โ”‚
โ”‚ โ”‚ de_aliased_model_id = 'coco/3'                                                               โ”‚ โ”‚
โ”‚ โ”‚            model_id = 'coco/3'                                                               โ”‚ โ”‚
โ”‚ โ”‚                self = <inference_sdk.http.client.InferenceHTTPClient object at               โ”‚ โ”‚
โ”‚ โ”‚                       0x7f1e10239ae0>                                                        โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/inference_sdk/http/client.py:81 in decorate              โ”‚
โ”‚                                                                                                  โ”‚
โ”‚     78 def wrap_errors(function: callable) -> callable:                                          โ”‚
โ”‚     79 โ”‚   def decorate(*args, **kwargs) -> Any:                                                 โ”‚
โ”‚     80 โ”‚   โ”‚   try:                                                                              โ”‚
โ”‚ โฑ   81 โ”‚   โ”‚   โ”‚   return function(*args, **kwargs)                                              โ”‚
โ”‚     82 โ”‚   โ”‚   except HTTPError as error:                                                        โ”‚
โ”‚     83 โ”‚   โ”‚   โ”‚   if "application/json" in error.response.headers.get("Content-Type", ""):      โ”‚
โ”‚     84 โ”‚   โ”‚   โ”‚   โ”‚   api_message = error.response.json().get("message")                        โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ       โ”‚
โ”‚ โ”‚     args = (<inference_sdk.http.client.InferenceHTTPClient object at 0x7f1e10239ae0>,) โ”‚       โ”‚
โ”‚ โ”‚ function = <function InferenceHTTPClient.list_loaded_models at 0x7f1e104105e0>         โ”‚       โ”‚
โ”‚ โ”‚   kwargs = {}                                                                          โ”‚       โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ       โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/inference_sdk/http/client.py:564 in list_loaded_models   โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    561 โ”‚   @wrap_errors                                                                          โ”‚
โ”‚    562 โ”‚   def list_loaded_models(self) -> RegisteredModels:                                     โ”‚
โ”‚    563 โ”‚   โ”‚   self.__ensure_v1_client_mode()                                                    โ”‚
โ”‚ โฑ  564 โ”‚   โ”‚   response = requests.get(f"{self.__api_url}/model/registry")                       โ”‚
โ”‚    565 โ”‚   โ”‚   response.raise_for_status()                                                       โ”‚
โ”‚    566 โ”‚   โ”‚   response_payload = response.json()                                                โ”‚
โ”‚    567 โ”‚   โ”‚   return RegisteredModels.from_dict(response_payload)                               โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ              โ”‚
โ”‚ โ”‚ self = <inference_sdk.http.client.InferenceHTTPClient object at 0x7f1e10239ae0> โ”‚              โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ              โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/requests/api.py:73 in get                                โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    70 โ”‚   :rtype: requests.Response                                                              โ”‚
โ”‚    71 โ”‚   """                                                                                    โ”‚
โ”‚    72 โ”‚                                                                                          โ”‚
โ”‚ โฑ  73 โ”‚   return request("get", url, params=params, **kwargs)                                    โ”‚
โ”‚    74                                                                                            โ”‚
โ”‚    75                                                                                            โ”‚
โ”‚    76 def options(url, **kwargs):                                                                โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ                                              โ”‚
โ”‚ โ”‚ kwargs = {}                                     โ”‚                                              โ”‚
โ”‚ โ”‚ params = None                                   โ”‚                                              โ”‚
โ”‚ โ”‚    url = 'http://localhost:9001/model/registry' โ”‚                                              โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ                                              โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/requests/api.py:59 in request                            โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    56 โ”‚   # avoid leaving sockets open which can trigger a ResourceWarning in some               โ”‚
โ”‚    57 โ”‚   # cases, and look like a memory leak in others.                                        โ”‚
โ”‚    58 โ”‚   with sessions.Session() as session:                                                    โ”‚
โ”‚ โฑ  59 โ”‚   โ”‚   return session.request(method=method, url=url, **kwargs)                           โ”‚
โ”‚    60                                                                                            โ”‚
โ”‚    61                                                                                            โ”‚
โ”‚    62 def get(url, params=None, **kwargs):                                                       โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ                               โ”‚
โ”‚ โ”‚  kwargs = {'params': None}                                     โ”‚                               โ”‚
โ”‚ โ”‚  method = 'get'                                                โ”‚                               โ”‚
โ”‚ โ”‚ session = <requests.sessions.Session object at 0x7f1e10238f10> โ”‚                               โ”‚
โ”‚ โ”‚     url = 'http://localhost:9001/model/registry'               โ”‚                               โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ                               โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/requests/sessions.py:589 in request                      โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   586 โ”‚   โ”‚   โ”‚   "allow_redirects": allow_redirects,                                            โ”‚
โ”‚   587 โ”‚   โ”‚   }                                                                                  โ”‚
โ”‚   588 โ”‚   โ”‚   send_kwargs.update(settings)                                                       โ”‚
โ”‚ โฑ 589 โ”‚   โ”‚   resp = self.send(prep, **send_kwargs)                                              โ”‚
โ”‚   590 โ”‚   โ”‚                                                                                      โ”‚
โ”‚   591 โ”‚   โ”‚   return resp                                                                        โ”‚
โ”‚   592                                                                                            โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ  โ”‚
โ”‚ โ”‚ allow_redirects = True                                                                      โ”‚  โ”‚
โ”‚ โ”‚            auth = None                                                                      โ”‚  โ”‚
โ”‚ โ”‚            cert = None                                                                      โ”‚  โ”‚
โ”‚ โ”‚         cookies = None                                                                      โ”‚  โ”‚
โ”‚ โ”‚            data = None                                                                      โ”‚  โ”‚
โ”‚ โ”‚           files = None                                                                      โ”‚  โ”‚
โ”‚ โ”‚         headers = None                                                                      โ”‚  โ”‚
โ”‚ โ”‚           hooks = None                                                                      โ”‚  โ”‚
โ”‚ โ”‚            json = None                                                                      โ”‚  โ”‚
โ”‚ โ”‚          method = 'get'                                                                     โ”‚  โ”‚
โ”‚ โ”‚          params = None                                                                      โ”‚  โ”‚
โ”‚ โ”‚            prep = <PreparedRequest [GET]>                                                   โ”‚  โ”‚
โ”‚ โ”‚         proxies = {}                                                                        โ”‚  โ”‚
โ”‚ โ”‚             req = <Request [GET]>                                                           โ”‚  โ”‚
โ”‚ โ”‚            self = <requests.sessions.Session object at 0x7f1e10238f10>                      โ”‚  โ”‚
โ”‚ โ”‚     send_kwargs = {                                                                         โ”‚  โ”‚
โ”‚ โ”‚                   โ”‚   'timeout': None,                                                      โ”‚  โ”‚
โ”‚ โ”‚                   โ”‚   'allow_redirects': True,                                              โ”‚  โ”‚
โ”‚ โ”‚                   โ”‚   'proxies': OrderedDict(),                                             โ”‚  โ”‚
โ”‚ โ”‚                   โ”‚   'stream': False,                                                      โ”‚  โ”‚
โ”‚ โ”‚                   โ”‚   'verify': True,                                                       โ”‚  โ”‚
โ”‚ โ”‚                   โ”‚   'cert': None                                                          โ”‚  โ”‚
โ”‚ โ”‚                   }                                                                         โ”‚  โ”‚
โ”‚ โ”‚        settings = {'proxies': OrderedDict(), 'stream': False, 'verify': True, 'cert': None} โ”‚  โ”‚
โ”‚ โ”‚          stream = None                                                                      โ”‚  โ”‚
โ”‚ โ”‚         timeout = None                                                                      โ”‚  โ”‚
โ”‚ โ”‚             url = 'http://localhost:9001/model/registry'                                    โ”‚  โ”‚
โ”‚ โ”‚          verify = None                                                                      โ”‚  โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ  โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/requests/sessions.py:703 in send                         โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   700 โ”‚   โ”‚   start = preferred_clock()                                                          โ”‚
โ”‚   701 โ”‚   โ”‚                                                                                      โ”‚
โ”‚   702 โ”‚   โ”‚   # Send the request                                                                 โ”‚
โ”‚ โฑ 703 โ”‚   โ”‚   r = adapter.send(request, **kwargs)                                                โ”‚
โ”‚   704 โ”‚   โ”‚                                                                                      โ”‚
โ”‚   705 โ”‚   โ”‚   # Total elapsed time of the request (approximately)                                โ”‚
โ”‚   706 โ”‚   โ”‚   elapsed = preferred_clock() - start                                                โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ                   โ”‚
โ”‚ โ”‚         adapter = <requests.adapters.HTTPAdapter object at 0x7f1e10239de0> โ”‚                   โ”‚
โ”‚ โ”‚ allow_redirects = True                                                     โ”‚                   โ”‚
โ”‚ โ”‚           hooks = {'response': []}                                         โ”‚                   โ”‚
โ”‚ โ”‚          kwargs = {                                                        โ”‚                   โ”‚
โ”‚ โ”‚                   โ”‚   'timeout': None,                                     โ”‚                   โ”‚
โ”‚ โ”‚                   โ”‚   'proxies': OrderedDict(),                            โ”‚                   โ”‚
โ”‚ โ”‚                   โ”‚   'stream': False,                                     โ”‚                   โ”‚
โ”‚ โ”‚                   โ”‚   'verify': True,                                      โ”‚                   โ”‚
โ”‚ โ”‚                   โ”‚   'cert': None                                         โ”‚                   โ”‚
โ”‚ โ”‚                   }                                                        โ”‚                   โ”‚
โ”‚ โ”‚         request = <PreparedRequest [GET]>                                  โ”‚                   โ”‚
โ”‚ โ”‚            self = <requests.sessions.Session object at 0x7f1e10238f10>     โ”‚                   โ”‚
โ”‚ โ”‚           start = 1710104956.0023863                                       โ”‚                   โ”‚
โ”‚ โ”‚          stream = False                                                    โ”‚                   โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ                   โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /opt/conda/lib/python3.10/site-packages/requests/adapters.py:519 in send                         โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   516 โ”‚   โ”‚   โ”‚   โ”‚   # This branch is for urllib3 v1.22 and later.                              โ”‚
โ”‚   517 โ”‚   โ”‚   โ”‚   โ”‚   raise SSLError(e, request=request)                                         โ”‚
โ”‚   518 โ”‚   โ”‚   โ”‚                                                                                  โ”‚
โ”‚ โฑ 519 โ”‚   โ”‚   โ”‚   raise ConnectionError(e, request=request)                                      โ”‚
โ”‚   520 โ”‚   โ”‚                                                                                      โ”‚
โ”‚   521 โ”‚   โ”‚   except ClosedPoolError as e:                                                       โ”‚
โ”‚   522 โ”‚   โ”‚   โ”‚   raise ConnectionError(e, request=request)                                      โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ               โ”‚
โ”‚ โ”‚    cert = None                                                                 โ”‚               โ”‚
โ”‚ โ”‚ chunked = False                                                                โ”‚               โ”‚
โ”‚ โ”‚    conn = <urllib3.connectionpool.HTTPConnectionPool object at 0x7f1e10239f00> โ”‚               โ”‚
โ”‚ โ”‚ proxies = OrderedDict()                                                        โ”‚               โ”‚
โ”‚ โ”‚ request = <PreparedRequest [GET]>                                              โ”‚               โ”‚
โ”‚ โ”‚    self = <requests.adapters.HTTPAdapter object at 0x7f1e10239de0>             โ”‚               โ”‚
โ”‚ โ”‚  stream = False                                                                โ”‚               โ”‚
โ”‚ โ”‚ timeout = Timeout(connect=None, read=None, total=None)                         โ”‚               โ”‚
โ”‚ โ”‚     url = '/model/registry'                                                    โ”‚               โ”‚
โ”‚ โ”‚  verify = True                                                                 โ”‚               โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ               โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
ConnectionError: HTTPConnectionPool(host='localhost', port=9001): Max retries exceeded with url: /model/registry (Caused by 
NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1e1023a350>: Failed to establish a new connection: [Errno 111] Connection refused'))
[email protected]:/$ 

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Does Inference not work with Windows?

Search before asking

  • I have searched the Inference issues and found no similar feature requests.

Question

I am trying to run inference on Windows to do inferencing with YOLO v8 with my GPU. When I try inference server start I get the following error: TypeError: Invalid type for device_requests param: expected list but found <class 'tuple'>.

This works: docker run --network=host --gpus=all roboflow/roboflow-inference-server-gpu:latest but then the server does not accept any requests:
ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=9001): Max retries exceeded with url: /doctr/ocr?api_key=St4BLhrH2dLkV8EQuXG4 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001C585F67150>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

Additional

No response

GPU Acceleration Doesn't Work with CUDA 12

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

If you install inference-gpu on a machine with CUDA 12 it'll complain and fall back to CPU execution mode.

2024-03-10 21:00:56.403012156 [W:onnxruntime:Default, onnxruntime_pybind_state.cc:640 CreateExecutionProviderInstance] Failed to create CUDAExecutionProvider. Please reference https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements to ensure all dependencies are met.

There's a special version of onnxruntime needed for CUDA 12: https://onnxruntime.ai/docs/install/

Ideally we'd detect this automatically & make it "just work" with CUDA 12. But alternatively we could let the user know why they're not getting GPU acceleration.

Environment

[email protected]:/$ pip freeze | grep inference
inference-cli==0.9.15
inference-gpu==0.9.15
inference-sdk==0.9.15
[email protected]:/$ 

pytorch/pytorch:2.2.0-cuda12.1-cudnn8-devel docker with after running pip install inference-gpu

image

Minimal Reproducible Example

pip install inference-gpu
inference benchmark python-package-speed -m "yolov8n-640"

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Inference directly on the image in the form of `np.ndarray` without the need to save it to hard drive

Inference now takes the path to the image rather than the image itself. This makes video file processing highly suboptimal and creates a bottleneck.

import requests

url = f"http://localhost:9001/{DATASET_ID}/{VERSION_ID}"

params = {
    "api_key": ROBOFLOW_API_KEY,
    "confidence": 0.5,
    "image": IMAGE_URL,
}

res = requests.post(url, params=params)
print(res.json())

It would be great if inference took np.ndarray directly. Example below is just pseudo-code.

import requests
import supervision as sv

url = f"http://localhost:9001/{DATASET_ID}/{VERSION_ID}"

for frame in sv.get_video_frames_generator(source_path=VIDEO_PATH):

    params = {
        "api_key": ROBOFLOW_API_KEY,
        "confidence": 0.5,
        "image": frame,
    }
    
    res = requests.post(url, params=params)
    print(res.json())

๐Ÿ™‹๐Ÿป I would love to work on the implementation of this feature.

YOLOWorld Strange behavoir

Search before asking

  • I have searched the Inference issues and found no similar feature requests.

Question

After playing around with the yoloworld model for a while, I have seen that the model will only ever return results if it detects two of the classes you have set with set_classes. I passed the example dog image, as well as other images, repeatedly, with one class "dog" and it returns nothing, but if I pass it ["person", "dog"] it will return both. I don't see any flaws in the text embedding logic, but seems like something in the model is stopping it from detecting single classes.

Additional

No response

LMM workflow step - rename to LLM

Search before asking

  • I have searched the Inference issues and found no similar feature requests.

Description

Rename:
LMM -> LLM
LMMForClassification -> LLMForClassification

Use case

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Model manager with fixed batch size is broken

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

If we exceed the limit of models to be kept in memory and the purge should happen - error happens:

Traceback (most recent call last):
  File "/app/inference/core/interfaces/http/http_api.py", line 158, in wrapped_route
    return await route(*args, **kwargs)
  File "/app/inference/core/interfaces/http/http_api.py", line 476, in model_add
    self.model_manager.add_model(request.model_id, request.api_key)
  File "/app/inference/core/managers/decorators/fixed_size_cache.py", line 43, in add_model
    self.remove(to_remove_model_id)
  File "/app/inference/core/managers/decorators/fixed_size_cache.py", line 58, in remove
    return super().remove(model_id)
  File "/app/inference/core/managers/decorators/base.py", line 130, in remove
    return self.model_manager.remove(model_id)
  File "/app/inference/core/managers/base.py", line 260, in remove
    self._models[model_id].clear_cache()
  File "/app/inference/core/models/roboflow.py", line 145, in clear_cache
    clear_cache(model_id=self.endpoint)
  File "/app/inference/core/cache/model_artifacts.py", line 92, in clear_cache
    shutil.rmtree(cache_dir)
  File "/usr/local/lib/python3.9/shutil.py", line 724, in rmtree
    onerror(os.lstat, path, sys.exc_info())
  File "/usr/local/lib/python3.9/shutil.py", line 722, in rmtree
    orig_st = os.lstat(path)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/cache/coco-dataset-vdnr1/4'

Environment

HTTP API container

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Video Inference

Hello, Roboflow is presented with an amazing detection of soccer players in this tweet, is it possible to provide an example of video inference then?

Thank you in advance!

Error on Inference on Raspberry Pi

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

Hi, I am using Raspberry Pi to do Inference using RTSP stream with below code:

# import the InferencePipeline interface
from inference import InferencePipeline
# import a built in sink called render_boxes (sinks are the logic that happens after inference)
from inference.core.interfaces.stream.sinks import render_boxes

# create an inference pipeline object
pipeline = InferencePipeline.init(
    model_id="cow-lie-stand-walk/2", # set the model id to a yolov8x model with in put size 1280
    video_reference="rtsp://192.168.1.100:5543/live/channel0", # set the video reference (source of video), it can be a link/path to a video file, an RTSP stream url, or an integer representing a device id (usually 0 for built in webcams)
    on_prediction=render_boxes, # tell the pipeline object what to do with each set of inference by passing a function
    api_key="<API-KEY>", # provide your roboflow api key for loading models from the roboflow api
)
# start the pipeline
pipeline.start()
# wait for the pipeline to finish
pipeline.join()

The above code is working fine for my Windows 11, but giving following error for my raspberry Pi

[02/10/24 20:11:11] ERROR    Could not sent prediction with frame_id=3493 to sink due to error: OpenCV(4.8.0) /io/opencv/modules/highgui/src/window.cpp:1272:   sinks.py:252 error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage'  

Please let me know how to fix this.

Environment

-inference : 0.9.9 -OS: Ubuntu 23.04 -Device: Raspberry Pi 4 Model B(8GB) -Python: 3.11.6

Minimal Reproducible Example

# import the InferencePipeline interface
from inference import InferencePipeline
# import a built in sink called render_boxes (sinks are the logic that happens after inference)
from inference.core.interfaces.stream.sinks import render_boxes

# create an inference pipeline object
pipeline = InferencePipeline.init(
    model_id="cow-lie-stand-walk/2", # set the model id to a yolov8x model with in put size 1280
    video_reference="rtsp://192.168.1.100:5543/live/channel0", # set the video reference (source of video), it can be a link/path to a video file, an RTSP stream url, or an integer representing a device id (usually 0 for built in webcams)
    on_prediction=render_boxes, # tell the pipeline object what to do with each set of inference by passing a function
    api_key="<API-KEY>", # provide your roboflow api key for loading models from the roboflow api
)
# start the pipeline
pipeline.start()
# wait for the pipeline to finish
pipeline.join()

Save the above code in Python file and run the mentioned Device and OS. Make sure to put a valid RTSP url

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

If you install inside of Docker you need to ensure you have additional dependencies otherwise you get an error.

Ideally we should not require these (I think there's a headless version of cv2 we could use). Alternatively maybe we could catch this error and recommend the solve: apt-get update && apt-get install ffmpeg libsm6 libxext6 -y

Environment

[email protected]:/$ pip freeze | grep inference
inference-cli==0.9.15
inference-gpu==0.9.15
inference-sdk==0.9.15
[email protected]:/$ 

pytorch/pytorch:2.2.0-cuda12.1-cudnn8-devel docker with after running pip install inference-gpu

image

Minimal Reproducible Example

[email protected]:~$ inference benchmark python-package-speed -m "yolov8n-640"
Traceback (most recent call last):
  File "/usr/local/bin/inference", line 5, in <module>
    from inference_cli.main import app
  File "/usr/local/lib/python3.10/dist-packages/inference_cli/main.py", line 6, in <module>
    import inference_cli.lib
  File "/usr/local/lib/python3.10/dist-packages/inference_cli/lib/__init__.py", line 8, in <module>
    from inference_cli.lib.container_adapter import (
  File "/usr/local/lib/python3.10/dist-packages/inference_cli/lib/container_adapter.py", line 10, in <module>
    from inference_cli.lib.utils import read_env_file
  File "/usr/local/lib/python3.10/dist-packages/inference_cli/lib/utils.py", line 5, in <module>
    from supervision.utils.file import read_yaml_file
  File "/usr/local/lib/python3.10/dist-packages/supervision/__init__.py", line 9, in <module>
    from supervision.annotators.core import (
  File "/usr/local/lib/python3.10/dist-packages/supervision/annotators/core.py", line 4, in <module>
    import cv2
  File "/usr/local/lib/python3.10/dist-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/usr/local/lib/python3.10/dist-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
[email protected]:~$ D

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

`TypeError: Invalid type for device_requests param: expected list but found <class 'tuple'>` when `inference server start` on AWS `g4dn.xlarge` instance

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

I am trying to run CogVLM inference on an AWS instance, however when I run inference server start I encounter the error TypeError: Invalid type for device_requests param: expected list but found <class 'tuple'>.

GPU detected. Using a GPU image.
Starting inference server container...
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Traceback (most recent call last) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ /home/ubuntu/.local/lib/python3.8/site-packages/inference_cli/server.py:30 in start              โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   27 โ”‚   โ”‚   ),                                                                                  โ”‚
โ”‚   28 โ”‚   ] = "roboflow-platform",                                                                โ”‚
โ”‚   29 ):                                                                                          โ”‚
โ”‚ โฑ 30 โ”‚   start_inference_container("", port=port, project=rf_env)                                โ”‚
โ”‚   31                                                                                             โ”‚
โ”‚   32                                                                                             โ”‚
โ”‚   33 @server_app.command()                                                                       โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ                                                                 โ”‚
โ”‚ โ”‚   port = 9001                โ”‚                                                                 โ”‚
โ”‚ โ”‚ rf_env = 'roboflow-platform' โ”‚                                                                 โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ                                                                 โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/ubuntu/.local/lib/python3.8/site-packages/inference_cli/lib/container_adapter.py:92 in     โ”‚
โ”‚ start_inference_container                                                                        โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    89 โ”‚   โ”‚   )                                                                                  โ”‚
โ”‚    90 โ”‚                                                                                          โ”‚
โ”‚    91 โ”‚   print(f"Starting inference server container...")                                       โ”‚
โ”‚ โฑ  92 โ”‚   docker_client.containers.run(                                                          โ”‚
โ”‚    93 โ”‚   โ”‚   image=image,                                                                       โ”‚
โ”‚    94 โ”‚   โ”‚   privileged=privileged,                                                             โ”‚
โ”‚    95 โ”‚   โ”‚   detach=True,                                                                       โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ                            โ”‚
โ”‚ โ”‚         api_key = ''                                              โ”‚                            โ”‚
โ”‚ โ”‚      containers = []                                              โ”‚                            โ”‚
โ”‚ โ”‚       device_id = None                                            โ”‚                            โ”‚
โ”‚ โ”‚ device_requests = (                                               โ”‚                            โ”‚
โ”‚ โ”‚                   โ”‚   [                                           โ”‚                            โ”‚
โ”‚ โ”‚                   โ”‚   โ”‚   {                                       โ”‚                            โ”‚
โ”‚ โ”‚                   โ”‚   โ”‚   โ”‚   'Driver': '',                       โ”‚                            โ”‚
โ”‚ โ”‚                   โ”‚   โ”‚   โ”‚   'Count': 0,                         โ”‚                            โ”‚
โ”‚ โ”‚                   โ”‚   โ”‚   โ”‚   'DeviceIDs': ['all'],               โ”‚                            โ”‚
โ”‚ โ”‚                   โ”‚   โ”‚   โ”‚   'Capabilities': [['gpu']],          โ”‚                            โ”‚
โ”‚ โ”‚                   โ”‚   โ”‚   โ”‚   'Options': {}                       โ”‚                            โ”‚
โ”‚ โ”‚                   โ”‚   โ”‚   }                                       โ”‚                            โ”‚
โ”‚ โ”‚                   โ”‚   ],                                          โ”‚                            โ”‚
โ”‚ โ”‚                   )                                               โ”‚                            โ”‚
โ”‚ โ”‚           image = 'roboflow/roboflow-inference-server-gpu:latest' โ”‚                            โ”‚
โ”‚ โ”‚          labels = None                                            โ”‚                            โ”‚
โ”‚ โ”‚ metrics_enabled = True                                            โ”‚                            โ”‚
โ”‚ โ”‚     num_workers = 1                                               โ”‚                            โ”‚
โ”‚ โ”‚            port = 9001                                            โ”‚                            โ”‚
โ”‚ โ”‚      privileged = True                                            โ”‚                            โ”‚
โ”‚ โ”‚         project = 'roboflow-platform'                             โ”‚                            โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ                            โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/ubuntu/.local/lib/python3.8/site-packages/docker/models/containers.py:858 in run           โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    855 โ”‚   โ”‚   โ”‚   )                                                                             โ”‚
โ”‚    856 โ”‚   โ”‚                                                                                     โ”‚
โ”‚    857 โ”‚   โ”‚   try:                                                                              โ”‚
โ”‚ โฑ  858 โ”‚   โ”‚   โ”‚   container = self.create(image=image, command=command,                         โ”‚
โ”‚    859 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   detach=detach, **kwargs)                              โ”‚
โ”‚    860 โ”‚   โ”‚   except ImageNotFound:                                                             โ”‚
โ”‚    861 โ”‚   โ”‚   โ”‚   self.client.images.pull(image, platform=platform)                             โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ           โ”‚
โ”‚ โ”‚  command = None                                                                    โ”‚           โ”‚
โ”‚ โ”‚   detach = True                                                                    โ”‚           โ”‚
โ”‚ โ”‚    image = 'roboflow/roboflow-inference-server-gpu:latest'                         โ”‚           โ”‚
โ”‚ โ”‚   kwargs = {                                                                       โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   'privileged': True,                                                 โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   'labels': None,                                                     โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   'ports': {'9001': 9001},                                            โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   'device_requests': (                                                โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   โ”‚   [                                                               โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   โ”‚   โ”‚   {                                                           โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   โ”‚   โ”‚   โ”‚   'Driver': '',                                           โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   โ”‚   โ”‚   โ”‚   'Count': 0,                                             โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   โ”‚   โ”‚   โ”‚   'DeviceIDs': ['all'],                                   โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   โ”‚   โ”‚   โ”‚   'Capabilities': [['gpu']],                              โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   โ”‚   โ”‚   โ”‚   'Options': {}                                           โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   โ”‚   โ”‚   }                                                           โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   โ”‚   ],                                                              โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   ),                                                                  โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   'environment': [                                                    โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   โ”‚   'HOST=0.0.0.0',                                                 โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   โ”‚   'PORT=9001',                                                    โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   โ”‚   'PROJECT=roboflow-platform',                                    โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   โ”‚   'METRICS_ENABLED=True',                                         โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   โ”‚   'DEVICE_ID=None',                                               โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   โ”‚   'API_KEY=',                                                     โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   โ”‚   'NUM_WORKERS=1'                                                 โ”‚           โ”‚
โ”‚ โ”‚            โ”‚   ]                                                                   โ”‚           โ”‚
โ”‚ โ”‚            }                                                                       โ”‚           โ”‚
โ”‚ โ”‚ platform = None                                                                    โ”‚           โ”‚
โ”‚ โ”‚   remove = False                                                                   โ”‚           โ”‚
โ”‚ โ”‚     self = <docker.models.containers.ContainerCollection object at 0x7f75b3bda430> โ”‚           โ”‚
โ”‚ โ”‚   stderr = False                                                                   โ”‚           โ”‚
โ”‚ โ”‚   stdout = True                                                                    โ”‚           โ”‚
โ”‚ โ”‚   stream = False                                                                   โ”‚           โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ           โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/ubuntu/.local/lib/python3.8/site-packages/docker/models/containers.py:916 in create        โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    913 โ”‚   โ”‚   kwargs['image'] = image                                                           โ”‚
โ”‚    914 โ”‚   โ”‚   kwargs['command'] = command                                                       โ”‚
โ”‚    915 โ”‚   โ”‚   kwargs['version'] = self.client.api._version                                      โ”‚
โ”‚ โฑ  916 โ”‚   โ”‚   create_kwargs = _create_container_args(kwargs)                                    โ”‚
โ”‚    917 โ”‚   โ”‚   resp = self.client.api.create_container(**create_kwargs)                          โ”‚
โ”‚    918 โ”‚   โ”‚   return self.get(resp['Id'])                                                       โ”‚
โ”‚    919                                                                                           โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ            โ”‚
โ”‚ โ”‚ command = None                                                                    โ”‚            โ”‚
โ”‚ โ”‚   image = 'roboflow/roboflow-inference-server-gpu:latest'                         โ”‚            โ”‚
โ”‚ โ”‚  kwargs = {}                                                                      โ”‚            โ”‚
โ”‚ โ”‚    self = <docker.models.containers.ContainerCollection object at 0x7f75b3bda430> โ”‚            โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ            โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/ubuntu/.local/lib/python3.8/site-packages/docker/models/containers.py:1140 in              โ”‚
โ”‚ _create_container_args                                                                           โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   1137 โ”‚   if kwargs:                                                                            โ”‚
โ”‚   1138 โ”‚   โ”‚   raise create_unexpected_kwargs_error('run', kwargs)                               โ”‚
โ”‚   1139 โ”‚                                                                                         โ”‚
โ”‚ โฑ 1140 โ”‚   create_kwargs['host_config'] = HostConfig(**host_config_kwargs)                       โ”‚
โ”‚   1141 โ”‚                                                                                         โ”‚
โ”‚   1142 โ”‚   # Fill in any kwargs which need processing by create_host_config first                โ”‚
โ”‚   1143 โ”‚   port_bindings = create_kwargs['host_config'].get('PortBindings')                      โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ           โ”‚
โ”‚ โ”‚      create_kwargs = {                                                             โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   'detach': True,                                           โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   'labels': None,                                           โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   'environment': [                                          โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   โ”‚   'HOST=0.0.0.0',                                       โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   โ”‚   'PORT=9001',                                          โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   โ”‚   'PROJECT=roboflow-platform',                          โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   โ”‚   'METRICS_ENABLED=True',                               โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   โ”‚   'DEVICE_ID=None',                                     โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   โ”‚   'API_KEY=',                                           โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   โ”‚   'NUM_WORKERS=1'                                       โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   ],                                                        โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   'image': 'roboflow/roboflow-inference-server-gpu:latest', โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   'command': None                                           โ”‚           โ”‚
โ”‚ โ”‚                      }                                                             โ”‚           โ”‚
โ”‚ โ”‚ host_config_kwargs = {                                                             โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   'privileged': True,                                       โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   'device_requests': (                                      โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   โ”‚   [                                                     โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   โ”‚   โ”‚   {                                                 โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   โ”‚   โ”‚   โ”‚   'Driver': '',                                 โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   โ”‚   โ”‚   โ”‚   'Count': 0,                                   โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   โ”‚   โ”‚   โ”‚   'DeviceIDs': ['all'],                         โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   โ”‚   โ”‚   โ”‚   'Capabilities': [['gpu']],                    โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   โ”‚   โ”‚   โ”‚   'Options': {}                                 โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   โ”‚   โ”‚   }                                                 โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   โ”‚   ],                                                    โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   ),                                                        โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   'version': '1.41',                                        โ”‚           โ”‚
โ”‚ โ”‚                      โ”‚   'port_bindings': {'9001': 9001}                           โ”‚           โ”‚
โ”‚ โ”‚                      }                                                             โ”‚           โ”‚
โ”‚ โ”‚                key = 'version'                                                     โ”‚           โ”‚
โ”‚ โ”‚             kwargs = {}                                                            โ”‚           โ”‚
โ”‚ โ”‚            network = None                                                          โ”‚           โ”‚
โ”‚ โ”‚ network_driver_opt = None                                                          โ”‚           โ”‚
โ”‚ โ”‚              ports = {'9001': 9001}                                                โ”‚           โ”‚
โ”‚ โ”‚            volumes = {}                                                            โ”‚           โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ           โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/ubuntu/.local/lib/python3.8/site-packages/docker/types/containers.py:641 in __init__       โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   638 โ”‚   โ”‚   โ”‚   if version_lt(version, '1.40'):                                                โ”‚
โ”‚   639 โ”‚   โ”‚   โ”‚   โ”‚   raise host_config_version_error('device_requests', '1.40')                 โ”‚
โ”‚   640 โ”‚   โ”‚   โ”‚   if not isinstance(device_requests, list):                                      โ”‚
โ”‚ โฑ 641 โ”‚   โ”‚   โ”‚   โ”‚   raise host_config_type_error(                                              โ”‚
โ”‚   642 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   'device_requests', device_requests, 'list'                             โ”‚
โ”‚   643 โ”‚   โ”‚   โ”‚   โ”‚   )                                                                          โ”‚
โ”‚   644 โ”‚   โ”‚   โ”‚   self['DeviceRequests'] = []                                                    โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ locals โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚ โ”‚         auto_remove = False                                                                  โ”‚ โ”‚
โ”‚ โ”‚               binds = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚        blkio_weight = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚ blkio_weight_device = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚             cap_add = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚            cap_drop = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚       cgroup_parent = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚            cgroupns = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚           cpu_count = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚         cpu_percent = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚          cpu_period = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚           cpu_quota = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚       cpu_rt_period = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚      cpu_rt_runtime = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚          cpu_shares = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚         cpuset_cpus = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚         cpuset_mems = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚ device_cgroup_rules = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚     device_read_bps = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚    device_read_iops = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚     device_requests = (                                                                      โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   [                                                                  โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   โ”‚   {                                                              โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   โ”‚   โ”‚   'Driver': '',                                              โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   โ”‚   โ”‚   'Count': 0,                                                โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   โ”‚   โ”‚   'DeviceIDs': ['all'],                                      โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   โ”‚   โ”‚   'Capabilities': [['gpu']],                                 โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   โ”‚   โ”‚   'Options': {}                                              โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   โ”‚   }                                                              โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   ],                                                                 โ”‚ โ”‚
โ”‚ โ”‚                       )                                                                      โ”‚ โ”‚
โ”‚ โ”‚    device_write_bps = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚   device_write_iops = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚             devices = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚                 dns = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚             dns_opt = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚          dns_search = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚         extra_hosts = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚           group_add = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚                init = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚           init_path = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚            ipc_mode = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚           isolation = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚       kernel_memory = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚               links = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚          log_config = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚            lxc_conf = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚           mem_limit = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚     mem_reservation = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚      mem_swappiness = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚       memswap_limit = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚              mounts = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚           nano_cpus = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚        network_mode = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚    oom_kill_disable = False                                                                  โ”‚ โ”‚
โ”‚ โ”‚       oom_score_adj = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚            pid_mode = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚          pids_limit = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚       port_bindings = {'9001': 9001}                                                         โ”‚ โ”‚
โ”‚ โ”‚          privileged = True                                                                   โ”‚ โ”‚
โ”‚ โ”‚   publish_all_ports = False                                                                  โ”‚ โ”‚
โ”‚ โ”‚           read_only = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚      restart_policy = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚             runtime = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚        security_opt = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚                self = {                                                                      โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   'Privileged': True,                                                โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   'NetworkMode': 'default',                                          โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   'PortBindings': {                                                  โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   โ”‚   '9001/tcp': [{'HostIp': '', 'HostPort': '9001'}]               โ”‚ โ”‚
โ”‚ โ”‚                       โ”‚   }                                                                  โ”‚ โ”‚
โ”‚ โ”‚                       }                                                                      โ”‚ โ”‚
โ”‚ โ”‚            shm_size = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚         storage_opt = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚             sysctls = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚               tmpfs = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚             ulimits = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚         userns_mode = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚            uts_mode = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚             version = '1.41'                                                                 โ”‚ โ”‚
โ”‚ โ”‚       volume_driver = None                                                                   โ”‚ โ”‚
โ”‚ โ”‚        volumes_from = None                                                                   โ”‚ โ”‚
โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
TypeError: Invalid type for device_requests param: expected list but found <class 'tuple'>

Environment

  • pip list | grep inference result:

    inference                         0.9.6
    inference-cli                     0.9.6
    
  • nvidia-smi result:

    Mon Dec 18 14:31:51 2023
    +-----------------------------------------------------------------------------+
    | NVIDIA-SMI 510.73.08    Driver Version: 510.73.08    CUDA Version: 11.6     |
    |-------------------------------+----------------------+----------------------+
    | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
    | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
    |                               |                      |               MIG M. |
    |===============================+======================+======================|
    |   0  Tesla T4            On   | 00000000:00:1E.0 Off |                    0 |
    | N/A   22C    P8    14W /  70W |      0MiB / 15360MiB |      0%      Default |
    |                               |                      |                  N/A |
    +-------------------------------+----------------------+----------------------+
    
    +-----------------------------------------------------------------------------+
    | Processes:                                                                  |
    |  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
    |        ID   ID                                                   Usage      |
    |=============================================================================|
    |  No running processes found                                                 |
    +-----------------------------------------------------------------------------+
    
  • docker --version result:

    Docker version 20.10.17, build 100c701
    

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Possible documentation mistake for HTTP inference with numpy arrays

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

On the roboflow website, the local http inference payload structure for "NumPy Array" image payloads is documented as

{
# ...
    "image": {
        "type": "numpy",
        "value": image,
    },
# ...
}

Where image is initialized as

image = Image.open(file_name)

However, if you attempt to use requests.post as recommended on the same page, it will complain TypeError: Object of type PngImageFile is not JSON serializable

There seems to be two mistakes here:

  1. The documentation titles the example as "numpy array", but never retrieves the numpy array from the ImageFile object.
  2. The documentation appears to be missing a step to serialize the numpy array to a form acceptable for JSON serialization.

Environment

Python 3.10.12

requests 2.31.0
Pillow 10.1.0

Docker Image roboflow/roboflow-inference-server-gpu version 0.9.4

Minimal Reproducible Example

  1. Launch roboflow inference docker container with docker run --network=host --gpus=all roboflow/roboflow-inference-server-gpu -v roboflow-model-cache:/cache --name=roboflow_inference
  2. Follow example as documented in https://inference.roboflow.com/quickstart/http_inference/#step-2-run-inference under the tab "NumPy Array"

Additional

Checking against roboflow/roboflow-api-snippets suggests that using numpy arrays over the HTTP inference API is not possible as snippets in that repository always serialize the numpy array to base64 first.

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Duplicate Inference with `client.infer_on_stream()` on Windows

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

The Issue

I'm currently experiencing unexpected behavior when running inference on a directory of images using inference_sdk. When I run the method infer_on_stream() the context manager loops through the files twice on Windows 10 resulting in double the inferences.

Below is a code snippet to recreate the issue.

from inference_sdk import InferenceHTTPClient

image_path="C:\\Users\\nick\\Desktop\\bug\\images"

client = InferenceHTTPClient(
    api_url="https://detect.roboflow.com/",
    api_key="" # redacted
)

for file_path, image, prediction in client.infer_on_stream(input_uri=image_path, model_id="coco/3"):
    print(file_path)

Image Dir Contents:

image

Console Output:

image

Environment

  • inference-sdk 0.9.20
  • Python 3.10.11
  • Windows 10

Minimal Reproducible Example

from inference_sdk import InferenceHTTPClient

image_path="C:\\Users\\nick\\Desktop\\bug\\images"

client = InferenceHTTPClient(
    api_url="https://detect.roboflow.com/",
    api_key="" # redacted
)

for file_path, image, prediction in client.infer_on_stream(input_uri=image_path, model_id="coco/3"):
    print(file_path)

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Inference-cli installation doesn't install needed dependencies.

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

After installing the inference cli on a Nvidia Jetson Orin Nano, I'm trying to start the server by running a inference server start. I received an ModuleNotFoundError: No module named 'aiohttp'. I can move past the error by performing a pip install aiohttp. I then attempt to inference server start when I recieve the new error ModuleNotFoundError: No module named 'backoff'. I can move past the error by running pip install backoff. I would expect aiohttp and backoff to be installed with my original inference-cli install if they are dependencies.

Environment

  • inference-cli==0.9.15
  • inference-sdk==0.9.8
  • OS: Jetpack 5.1.1
  • Device: Nvidia Jetson Orin Nano
  • Python 3.8.10

Minimal Reproducible Example

Create virtual environment python3 -m venv venv
pip install inferences-cli
inference server start

When running the last command I get the following error:

(venv) nickherrig@jetson:~$ inference server start
Traceback (most recent call last):
  File "/home/nickherrig/venv/bin/inference", line 5, in <module>
    from inference_cli.main import app
  File "/home/nickherrig/venv/lib/python3.8/site-packages/inference_cli/main.py", line 6, in <module>
    import inference_cli.lib
  File "/home/nickherrig/venv/lib/python3.8/site-packages/inference_cli/lib/__init__.py", line 8, in <module>
    from inference_cli.lib.container_adapter import (
  File "/home/nickherrig/venv/lib/python3.8/site-packages/inference_cli/lib/container_adapter.py", line 10, in <module>
    from inference_cli.lib.utils import read_env_file
  File "/home/nickherrig/venv/lib/python3.8/site-packages/inference_cli/lib/utils.py", line 9, in <module>
    from inference_sdk import InferenceConfiguration, InferenceHTTPClient
  File "/home/nickherrig/venv/lib/python3.8/site-packages/inference_sdk/__init__.py", line 1, in <module>
    from inference_sdk.http.client import InferenceHTTPClient
  File "/home/nickherrig/venv/lib/python3.8/site-packages/inference_sdk/http/client.py", line 4, in <module>
    import aiohttp
ModuleNotFoundError: No module named 'aiohttp'

I can fix the error by pip install aiohttp

I then run inference server start and receive the new error:

(venv) nickherrig@jetson:~$ inference server start
Traceback (most recent call last):
  File "/home/nickherrig/venv/bin/inference", line 5, in <module>
    from inference_cli.main import app
  File "/home/nickherrig/venv/lib/python3.8/site-packages/inference_cli/main.py", line 6, in <module>
    import inference_cli.lib
  File "/home/nickherrig/venv/lib/python3.8/site-packages/inference_cli/lib/__init__.py", line 8, in <module>
    from inference_cli.lib.container_adapter import (
  File "/home/nickherrig/venv/lib/python3.8/site-packages/inference_cli/lib/container_adapter.py", line 10, in <module>
    from inference_cli.lib.utils import read_env_file
  File "/home/nickherrig/venv/lib/python3.8/site-packages/inference_cli/lib/utils.py", line 9, in <module>
    from inference_sdk import InferenceConfiguration, InferenceHTTPClient
  File "/home/nickherrig/venv/lib/python3.8/site-packages/inference_sdk/__init__.py", line 1, in <module>
    from inference_sdk.http.client import InferenceHTTPClient
  File "/home/nickherrig/venv/lib/python3.8/site-packages/inference_sdk/http/client.py", line 34, in <module>
    from inference_sdk.http.utils.executors import (
  File "/home/nickherrig/venv/lib/python3.8/site-packages/inference_sdk/http/utils/executors.py", line 9, in <module>
    import backoff
ModuleNotFoundError: No module named 'backoff'

From here I am able to start the inference server using the CPU.

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Ctrl+C Doesn't Exit Benchmark

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

I got a configuration error so want to exit the CLI benchmark before it finishes but Ctrl+C doesn't do anything. It just keeps going.

[email protected]:/$ inference benchmark python-package-speed -m "yolov8n-640"
Loading images...: 100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 8/8 [00:04<00:00,  1.79it/s]
Detected images dimensions: {(612, 612), (440, 640), (427, 640), (500, 375), (334, 500), (480, 640), (375, 500)}
Inference will be executed with the following parameters: {}
2024-03-10 21:00:56.403012156 [W:onnxruntime:Default, onnxruntime_pybind_state.cc:640 CreateExecutionProviderInstance] Failed to create CUDAExecutionProvider. Please reference https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements to ensure all dependencies are met.
Model details | task_type=object-detection | model_type=yolov8n | batch_size=batch | input_height=640 | input_width=640
Warming up model...: 100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 10/10 [00:07<00:00,  1.31it/s]
avg: 798.6ms    | rps: 1.2      | p75: 804.1ms  | p90: 804.1    | %err: 0.0
avg: 812.9ms    | rps: 0.9      | p75: 848.7ms  | p90: 894.4    | %err: 0.0
avg: 1287.8ms   | rps: 0.7      | p75: 896.0ms  | p90: 2625.1   | %err: 0.0
avg: 1390.6ms   | rps: 0.7      | p75: 1699.6ms | p90: 2337.5   | %err: 0.0
avg: 1439.3ms   | rps: 0.7      | p75: 1698.5ms | p90: 2125.1   | %err: 0.0
avg: 1460.6ms   | rps: 0.7      | p75: 1698.9ms | p90: 1912.7   | %err: 0.0
^C^C^C^Cavg: 1472.2ms   | rps: 0.7      | p75: 1700.0ms | p90: 1901.5   | %err: 0.0
^C^C^C^Cavg: 1381.2ms   | rps: 0.7      | p75: 1698.5ms | p90: 1845.4   | %err: 0.0
avg: 1321.5ms   | rps: 0.7      | p75: 1694.0ms | p90: 1790.5   | %err: 0.0
avg: 1239.1ms   | rps: 0.8      | p75: 1668.0ms | p90: 1730.3   | %err: 0.0
avg: 1186.2ms   | rps: 0.8      | p75: 1607.6ms | p90: 1700.2   | %err: 0.0
avg: 1129.2ms   | rps: 0.9      | p75: 1599.4ms | p90: 1700.2   | %err: 0.0
avg: 1084.3ms   | rps: 0.9      | p75: 1548.2ms | p90: 1699.6   | %err: 0.0
^C^C^Cavg: 1059.4ms     | rps: 0.9      | p75: 1178.0ms | p90: 1698.8   | %err: 0.0
^C^C^C^C

Environment

Environment

[email protected]:/$ pip freeze | grep inference
inference-cli==0.9.15
inference-gpu==0.9.15
inference-sdk==0.9.15
[email protected]:/$ 

pytorch/pytorch:2.2.0-cuda12.1-cudnn8-devel docker with after running pip install inference-gpu

image

Minimal Reproducible Example

inference benchmark python-package-speed -m "yolov8n-640"

Then try Ctrl+C

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Support for Pose Estimation?

Thank you so much for this valuable contribution! Curious if there are plans to add support for pose estimation / key point detection in the near future?

Can't run inference on AWS Lambda

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

I am running this code on AWS Lambda

import os
from inference_sdk import InferenceHTTPClient

def handler(event, context):
    client = InferenceHTTPClient(api_url="https://detect.roboflow.com",
                                 api_key=os.environ["ROBOFLOW_API_KEY"])
    img_path = "./pizza.jpg"
    return client.infer(img_path, model_id="pizza-identifier/3")

As part of a docker container that looks like this:

FROM public.ecr.aws/lambda/python:3.11

RUN yum install -y mesa-libGL

COPY requirements.txt ${LAMBDA_TASK_ROOT}

RUN pip install -r requirements.txt

COPY pizza.jpg ${LAMBDA_TASK_ROOT}

COPY lambda_function.py ${LAMBDA_TASK_ROOT}

CMD [ "lambda_function.handler" ]

My requirements.txt contains nothing but inference==0.9.17

When the code runs I get the following error. I have been trying to fix this and tried workarounds but to no avail. I understand that the error is somehow related to multiprocessing. I found this post from which I understand that multiprocessing isn't possible on AWS Lambda, however, my script does not control or trigger any multiprocessing.

This is the full error:

{
  "errorMessage": "[Errno 38] Function not implemented",
  "errorType": "OSError",
  "requestId": "703be804-fd86-4b44-88f9-ac54c87717be",
  "stackTrace": [
    "  File \"/var/task/lambda_function.py\", line 10, in handler\n    return client.infer(img_path, model_id=\"pizza-identifier/3\")\n",
    "  File \"/var/lang/lib/python3.11/site-packages/inference_sdk/http/client.py\", line 82, in decorate\n    return function(*args, **kwargs)\n",
    "  File \"/var/lang/lib/python3.11/site-packages/inference_sdk/http/client.py\", line 237, in infer\n    return self.infer_from_api_v0(\n",
    "  File \"/var/lang/lib/python3.11/site-packages/inference_sdk/http/client.py\", line 299, in infer_from_api_v0\n    responses = execute_requests_packages(\n",
    "  File \"/var/lang/lib/python3.11/site-packages/inference_sdk/http/utils/executors.py\", line 42, in execute_requests_packages\n    responses = make_parallel_requests(\n",
    "  File \"/var/lang/lib/python3.11/site-packages/inference_sdk/http/utils/executors.py\", line 58, in make_parallel_requests\n    with ThreadPool(processes=workers) as pool:\n",
    "  File \"/var/lang/lib/python3.11/multiprocessing/pool.py\", line 930, in __init__\n    Pool.__init__(self, processes, initializer, initargs)\n",
    "  File \"/var/lang/lib/python3.11/multiprocessing/pool.py\", line 196, in __init__\n    self._change_notifier = self._ctx.SimpleQueue()\n",
    "  File \"/var/lang/lib/python3.11/multiprocessing/context.py\", line 113, in SimpleQueue\n    return SimpleQueue(ctx=self.get_context())\n",
    "  File \"/var/lang/lib/python3.11/multiprocessing/queues.py\", line 341, in __init__\n    self._rlock = ctx.Lock()\n",
    "  File \"/var/lang/lib/python3.11/multiprocessing/context.py\", line 68, in Lock\n    return Lock(ctx=self.get_context())\n",
    "  File \"/var/lang/lib/python3.11/multiprocessing/synchronize.py\", line 169, in __init__\n    SemLock.__init__(self, SEMAPHORE, 1, 1, ctx=ctx)\n",
    "  File \"/var/lang/lib/python3.11/multiprocessing/synchronize.py\", line 57, in __init__\n    sl = self._semlock = _multiprocessing.SemLock(\n"
  ]
}

Environment

No response

Minimal Reproducible Example

No response

Additional

I am incredibly frustrated since I've been working on this for 9 hours now and would appreciate any hints!

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

`Docker Getting Started` link in docs returns 404

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

The link to Getting Started With Docker on this page: https://inference.roboflow.com/quickstart/devices/
links to https://inference.roboflow.com/docs/quickstart/docker which returns a 404 Page Not Found

Environment

No response

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Installing Inference does not work as it produces an error.

Search before asking

  • I have searched the Inference issues and found no similar bug report.

Bug

When using pip install inference-cpu it results in an error
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'? when getting the requirements to build wheel.

Environment

  • OS: macOS Sonoma 14.2.1
  • Conda version(for environment): 23.9.0
  • Python version: 3.12.1
  • Shell: zsh
  • Hardware: MacOS M1.

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.