Jangai commited on
Commit
1295972
·
verified ·
1 Parent(s): a6fcafd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import gradio as gr
2
  import torch
3
- from transformers import AutoFeatureExtractor, AutoModelForImageClassification
4
  from PIL import Image
5
  import numpy as np
6
  import logging
@@ -9,10 +9,10 @@ import logging
9
  logging.basicConfig(level=logging.DEBUG)
10
 
11
  # Load the pre-trained model and feature extractor
12
- model_name = "microsoft/quickdraw"
13
  logging.info("Loading image processor and model...")
14
- feature_extractor = AutoFeatureExtractor.from_pretrained(model_name)
15
- model = AutoModelForImageClassification.from_pretrained(model_name)
16
 
17
  # Define the prediction function
18
  def predict(image):
 
1
  import gradio as gr
2
  import torch
3
+ from transformers import DetrImageProcessor, DetrForObjectDetection
4
  from PIL import Image
5
  import numpy as np
6
  import logging
 
9
  logging.basicConfig(level=logging.DEBUG)
10
 
11
  # Load the pre-trained model and feature extractor
12
+ model_name = "IDEA-Research/grounding-dino-tiny"
13
  logging.info("Loading image processor and model...")
14
+ feature_extractor = DetrImageProcessor.from_pretrained(model_name)
15
+ model = DetrForObjectDetection.from_pretrained(model_name)
16
 
17
  # Define the prediction function
18
  def predict(image):