Spaces:
Sleeping
Sleeping
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") |