Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,13 @@
|
|
| 1 |
|
| 2 |
from transformers import pipeline
|
| 3 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
| 4 |
def model():
|
| 5 |
-
|
|
|
|
|
|
|
| 6 |
output=pipe("dogs1.webp")
|
| 7 |
return output
|
| 8 |
|
|
|
|
| 1 |
|
| 2 |
from transformers import pipeline
|
| 3 |
import streamlit as st
|
| 4 |
+
# Load model directly
|
| 5 |
+
from transformers import AutoImageProcessor, AutoModelForObjectDetection
|
| 6 |
+
|
| 7 |
def model():
|
| 8 |
+
processor = AutoImageProcessor.from_pretrained("facebook/detr-resnet-50")
|
| 9 |
+
model = AutoModelForObjectDetection.from_pretrained("facebook/detr-resnet-50")
|
| 10 |
+
pipe = pipeline("object-detection", model="processor)
|
| 11 |
output=pipe("dogs1.webp")
|
| 12 |
return output
|
| 13 |
|