Update README.md
Browse files
README.md
CHANGED
@@ -45,7 +45,9 @@ url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
|
45 |
image = Image.open(requests.get(url, stream=True).raw)
|
46 |
texts = [["a photo of a cat", "a photo of a dog"]]
|
47 |
inputs = processor(text=texts, images=image, return_tensors="pt")
|
48 |
-
|
|
|
|
|
49 |
|
50 |
# Target image sizes (height, width) to rescale box predictions [batch_size, 2]
|
51 |
target_sizes = torch.Tensor([image.size[::-1]])
|
|
|
45 |
image = Image.open(requests.get(url, stream=True).raw)
|
46 |
texts = [["a photo of a cat", "a photo of a dog"]]
|
47 |
inputs = processor(text=texts, images=image, return_tensors="pt")
|
48 |
+
|
49 |
+
with torch.no_grad():
|
50 |
+
outputs = model(**inputs)
|
51 |
|
52 |
# Target image sizes (height, width) to rescale box predictions [batch_size, 2]
|
53 |
target_sizes = torch.Tensor([image.size[::-1]])
|