nielsr HF staff commited on
Commit
27d9485
1 Parent(s): 8de90a4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -1
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
- outputs = model(**inputs)
 
 
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]])