pzzhang / VinVL

project page for VinVL
350 stars 25 forks source link

How to decode feature files? #3

Open Zhonghao2016 opened 3 years ago

Zhonghao2016 commented 3 years ago

Hello! Thanks for your wonderful work. May I know how to decode GQA pretrained feature files? Specifically, how to convert the base64 encoded features (data in features.tsv) to floating points? Thanks very much!

vinson2233 commented 3 years ago

I don't know whether this help, but in Image Captioning with Oscar, they use this line of code to decode base64 encoded features

features = np.frombuffer(base64.b64decode(feat_info['features']), np.float32).reshape((num_boxes, -1))

Zhonghao2016 commented 3 years ago

Thanks!