Spaces:
Running
Running
kendrickfff
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -29,19 +29,19 @@ llm = ChatGoogleGenerativeAI(model='gemini-1.5-pro')
|
|
29 |
processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")
|
30 |
model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")
|
31 |
|
32 |
-
# Load COCO class
|
33 |
COCO_CLASSES = [
|
34 |
-
'
|
35 |
-
'
|
36 |
-
'
|
37 |
-
'
|
38 |
-
'
|
39 |
-
'
|
40 |
-
'
|
41 |
-
'
|
42 |
-
'sink', 'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear', 'hair drier', 'toothbrush'
|
43 |
]
|
44 |
|
|
|
45 |
# Global chat history variable
|
46 |
chat_history = []
|
47 |
|
@@ -98,7 +98,7 @@ with gr.Blocks() as demo:
|
|
98 |
# User input components
|
99 |
msg = gr.Textbox(label="Type your message here...", placeholder="Enter your message...", show_label=False)
|
100 |
send_btn = gr.Button("Send")
|
101 |
-
img_upload = gr.Image(type="filepath", label="Upload an image for analysis")
|
102 |
|
103 |
# Define interactions
|
104 |
def handle_text_message(message):
|
|
|
29 |
processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")
|
30 |
model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")
|
31 |
|
32 |
+
# Load COCO class label
|
33 |
COCO_CLASSES = [
|
34 |
+
'airplane', 'apple', 'backpack', 'banana', 'baseball hat', 'baseball glove', 'bear', 'bed', 'bench', 'bicycle',
|
35 |
+
'bird', 'boat', 'book', 'bottle', 'bowl', 'broccoli', 'bus', 'cake', 'car', 'carrot', 'cat', 'cell phone', 'chair',
|
36 |
+
'clock', 'couch', 'cow', 'cup', 'dining table', 'dog', 'donut', 'elephant', 'fire hydrant', 'fork', 'frisbee',
|
37 |
+
'giraffe', 'hair drier', 'handbag', 'horse', 'hot dog', 'keyboard', 'kite', 'knife', 'laptop', 'microwave',
|
38 |
+
'motorcycle', 'mouse', 'orange', 'oven', 'parking meter', 'person', 'pizza', 'potted plant', 'refrigerator',
|
39 |
+
'remote', 'sandwich', 'scissors', 'sheep', 'sink', 'skateboard', 'skis', 'snowboard', 'spoon', 'sports ball',
|
40 |
+
'stop sign', 'suitcase', 'surfboard', 'teddy bear', 'tennis racket', 'tie', 'toaster', 'toilet', 'toothbrush',
|
41 |
+
'traffic light', 'train', 'truck', 'tv', 'umbrella', 'vase', 'wine glass'
|
|
|
42 |
]
|
43 |
|
44 |
+
|
45 |
# Global chat history variable
|
46 |
chat_history = []
|
47 |
|
|
|
98 |
# User input components
|
99 |
msg = gr.Textbox(label="Type your message here...", placeholder="Enter your message...", show_label=False)
|
100 |
send_btn = gr.Button("Send")
|
101 |
+
img_upload = gr.Image(type="filepath", label="Upload an image for analysis (Only detect 80 types of images recognized from COCO dataset. Check the list on https://blog.roboflow.com/microsoft-coco-classes/")
|
102 |
|
103 |
# Define interactions
|
104 |
def handle_text_message(message):
|