-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems decoding the predicted bboxes in TSV #9
Comments
Have you solved this bug? I am facing the same problem.. |
Yes, I did...I wrote a modified script for it. #!/usr/bin/env python """Generate bottom-up attention features as a tsv file. Can use cuda and multiple GPUs. Example:python generate_tsv.py --net res101 --dataset vg --out test.csv --cudafrom future import absolute_import import _init_paths import torchvision.transforms as transforms from scipy.misc import imreadfrom imageio import imread from model.nms.nms_wrapper import nmsfrom model.roi_layers import nms try: csv.field_size_limit(sys.maxsize) FIELDNAMES = ['image_id', 'image_w','image_h','num_boxes', 'boxes', 'features'] Settings for the number of features per image. To re-create pretrained features with 36 featuresper image, set both values to 36.MIN_BOXES = 36 MIN_BOXES = 10MAX_BOXES = 100def parse_args():
lr = cfg.TRAIN.LEARNING_RATE def _get_image_blob(im): im_shape = im_orig.shape processed_ims = [] for target_size in cfg.TEST.SCALES: Create a blob to hold the input imagesblob = im_list_to_blob(processed_ims) return blob, np.array(im_scale_factors) #build [image_path, image_id] for dataset, and you can create your own
def get_detections_from_im(fasterRCNN, classes, im_file, image_id, args, conf_thresh=0.2):
def load_model(args):
def generate_npy(outfile, image_ids, args):
if name == 'main':
|
I see. You didn't encode it. Thanks! |
When decoding 'bbox', I think it should be replaced by |
That's greatly useful for me! |
Hello, @AndresPMD .Thanks for your work, and now i can run the generate.py on my computer.However, i encounted a problem. When i run this python file on MSCOCO dataset, i got the error:IndexError:index 523573 is out of bounds for axis 0 with 40775. Can you help me? Thanks a lot. |
Hi! I had the same issue and came to report it, but I was able to solve my issue with a really small change to the code base. I'm assuming this bug didn't get caught since the bounding boxes retrieved in convert_data.py are never output, but I had added a command line option to choose whether to output features or bounding boxes, and the bounding box outputs looked really odd. It turns out, the values that are encoded are of type float64, but the buffer reader used is looking for data type float32! I changed "np.float32" to "np.float64" in convert_data.py, and the bounding boxes retrieved looked good with no other changes :D hope this is helpful if anyone else needs to use the bounding boxes in the future! UPDATE: just found the other people saying the same thing, which I missed my first time through since they were hidden between long responses I scrolled past; sorry for the repetition! |
Hello @shilrley6,
Congrats for your repo, it is quite useful.
Nonetheless, it seems I have found an error while decoding the boxes in the output of a TSV file. The image features are decoded correctly, but the bounding boxes are not.
I was testing the generate_tsv.py file, and even the predicted bboxes are correct, at the moment of encoding and storing the whole data is changed.
Have you encountered this issue? Any suggestion?
In my case, I can recompute another TSV and do not store the bboxes with this encoding....but it will take a lot of time to recompute it.
The text was updated successfully, but these errors were encountered: