Spaces:
Build error
Build error
Download utils/objectDetection/index.py from Image-Processsing/Backend: direct link, hf CLI and curl.
- Browser
- Download file 414 Bytes
-
https://huggingface.co/spaces/Image-Processsing/Backend/resolve/73d5d6cc7f2fc76911cfebe5f850f3bebfcd06d3/utils/objectDetection/index.py
- Command line
-
hf download hf://spaces/Image-Processsing/Backend@73d5d6cc7f2fc76911cfebe5f850f3bebfcd06d3/utils/objectDetection/index.py
-
curl -L -o index.py https://huggingface.co/spaces/Image-Processsing/Backend/resolve/73d5d6cc7f2fc76911cfebe5f850f3bebfcd06d3/utils/objectDetection/index.py
414 Bytes
| from transformers import pipeline | |
| from PIL import Image | |
| from io import BytesIO | |
| # Load the object detection pipeline | |
| object_detection_pipeline = pipeline("object-detection", model="ciasimbaya/ObjectDetection") | |
| def detect_objects(image_bytes): | |
| image = Image.open(BytesIO(image_bytes)) | |
| result = object_detection_pipeline(image) | |
| return result | |
| print("object detection model loaded succesfully") |