kendrickfff commited on
Commit
61993c7
·
verified ·
1 Parent(s): 9384fef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
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 labels (from the official COCO dataset)
33
  COCO_CLASSES = [
34
- 'N/A', 'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat',
35
- 'traffic light', 'fire hydrant', 'N/A', 'stop sign', 'parking meter', 'bench', 'bird', 'cat',
36
- 'dog', 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'N/A', 'backpack', 'umbrella',
37
- 'N/A', 'handbag', 'tie', 'suitcase', 'frisbee', 'skis', 'snowboard', 'sports ball', 'kite', 'baseball bat',
38
- 'baseball glove', 'skateboard', 'surfboard', 'tennis racket', 'bottle', 'N/A', 'wine glass', 'cup',
39
- 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple', 'sandwich', 'orange', 'broccoli', 'carrot',
40
- 'hot dog', 'pizza', 'donut', 'cake', 'chair', 'couch', 'potted plant', 'bed', 'dining table', 'toilet',
41
- 'N/A', 'tv', 'laptop', 'mouse', 'remote', 'keyboard', 'cell phone', 'microwave', 'oven', 'toaster',
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):