merve HF staff commited on
Commit
d957709
1 Parent(s): 8fb2f5d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -81,7 +81,7 @@ def query(image, confidence_threshold):
81
  inputs = processor(images=image, return_tensors="pt").to(device)
82
  with torch.no_grad():
83
  outputs = model(**inputs)
84
- target_sizes = torch.Tensor([np.array(image).shape[::-1]])
85
 
86
  results = processor.post_process_object_detection(outputs=outputs, threshold=confidence_threshold, target_sizes=target_sizes)
87
  return results
 
81
  inputs = processor(images=image, return_tensors="pt").to(device)
82
  with torch.no_grad():
83
  outputs = model(**inputs)
84
+ target_sizes = torch.tensor([image.size[::-1]])
85
 
86
  results = processor.post_process_object_detection(outputs=outputs, threshold=confidence_threshold, target_sizes=target_sizes)
87
  return results