bornasquare commited on
Commit
fb61ce4
1 Parent(s): c895acf

update readme

Browse files

minor fix so the bounding boxes returned can be drawn on the original image. Similar to the example in this page: https://huggingface.co/docs/transformers/en/model_doc/owlv2

Files changed (1) hide show
  1. README.md +1 -1
README.md CHANGED
@@ -64,7 +64,7 @@ def get_preprocessed_image(pixel_values):
64
 
65
  unnormalized_image = get_preprocessed_image(inputs.pixel_values)
66
 
67
- target_sizes = torch.Tensor([unnormalized_image.size[::-1]])
68
  # Convert outputs (bounding boxes and class logits) to final bounding boxes and scores
69
  results = processor.post_process_object_detection(
70
  outputs=outputs, threshold=0.2, target_sizes=target_sizes
 
64
 
65
  unnormalized_image = get_preprocessed_image(inputs.pixel_values)
66
 
67
+ target_sizes = torch.Tensor([image.size[::-1]]) # the bounding boxes can be drawn on the original image
68
  # Convert outputs (bounding boxes and class logits) to final bounding boxes and scores
69
  results = processor.post_process_object_detection(
70
  outputs=outputs, threshold=0.2, target_sizes=target_sizes