Kilos1 commited on
Commit
d0ee1ff
·
verified ·
1 Parent(s): 68e425a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -3,11 +3,13 @@ import base64
3
  from transformers import AutoModelForCausalLM, AutoTokenizer
4
  import gradio as gr
5
  from PIL import Image
 
6
 
7
- # Load the Hugging Face model and tokenizer
8
- model_id = "meta-llama/llama-3-2-90b-vision-instruct"
9
- tokenizer = AutoTokenizer.from_pretrained(model_id)
10
- model = AutoModelForCausalLM.from_pretrained(model_id)
 
11
 
12
  def input_image_setup(uploaded_file):
13
  """
 
3
  from transformers import AutoModelForCausalLM, AutoTokenizer
4
  import gradio as gr
5
  from PIL import Image
6
+ from transformers import Owlv2Processor, Owlv2ForObjectDetection
7
 
8
+ model_id = "IDEA-Research/grounding-dino-base"
9
+ device = "cuda" if torch.cuda.is_available() else "cpu"
10
+
11
+ processor = AutoProcessor.from_pretrained(model_id)
12
+ model = AutoModelForZeroShotObjectDetection.from_pretrained(model_id).to(device)
13
 
14
  def input_image_setup(uploaded_file):
15
  """