Update app.py
Browse filesChange to tangerine
app.py
CHANGED
|
@@ -10,11 +10,11 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
| 10 |
processor = AutoProcessor.from_pretrained(model_id)
|
| 11 |
model = AutoModelForZeroShotObjectDetection.from_pretrained(model_id).to(device)
|
| 12 |
|
| 13 |
-
image_url = "
|
| 14 |
image = Image.open(requests.get(image_url, stream=True).raw)
|
| 15 |
# Check for cats and remote controls
|
| 16 |
# VERY important: text queries need to be lowercased + end with a dot
|
| 17 |
-
text = "
|
| 18 |
|
| 19 |
inputs = processor(images=image, text=text, return_tensors="pt").to(device)
|
| 20 |
with torch.no_grad():
|
|
|
|
| 10 |
processor = AutoProcessor.from_pretrained(model_id)
|
| 11 |
model = AutoModelForZeroShotObjectDetection.from_pretrained(model_id).to(device)
|
| 12 |
|
| 13 |
+
image_url = "https://en.wikipedia.org/wiki/Tangerine#/media/File:TangerineFruit.jpg"
|
| 14 |
image = Image.open(requests.get(image_url, stream=True).raw)
|
| 15 |
# Check for cats and remote controls
|
| 16 |
# VERY important: text queries need to be lowercased + end with a dot
|
| 17 |
+
text = "oranges."
|
| 18 |
|
| 19 |
inputs = processor(images=image, text=text, return_tensors="pt").to(device)
|
| 20 |
with torch.no_grad():
|