Image-Processsing's picture
Upload 18 files
85b6267
raw
history blame contribute delete
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")