Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

resize the bbox with true size #62

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions script/extract_features_from_gt.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def get_batch_proposals(self, images, im_scales, im_infos, proposals):
).to("cuda")
orig_image_size = (img_info["width"], img_info["height"])
boxes = BoxList(boxes_tensor, orig_image_size)
image_size = (images.image_sizes[idx][1], images.image_sizes[idx][0])
image_size = (img_info["scale_width"], img_info["scale_height"])
boxes = boxes.resize(image_size)
proposals_batch.append(boxes)
return proposals_batch
Expand Down Expand Up @@ -130,7 +130,12 @@ def _image_transform(self, path):
)
img = torch.from_numpy(im).permute(2, 0, 1)

im_info = {"width": im_width, "height": im_height}
im_info = {
"width": im_width,
"height": im_height,
"scale_width": img.shape[2],
"scale_height": img.shape[1],
}

return img, im_scale, im_info

Expand Down