hprasath's picture
Upload 9 files
bbcc5b2 verified
raw
history blame
403 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")