Comments (1)
Hi,
- We used LVIS v1.0. We mapped the labels back to v0.5 when doing test set evaluation.
- Please find my (un-cleaned) script below:
import argparse
import json
import os
from detectron2.structures import Boxes, BoxMode
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--pred', default='')
parser.add_argument('--ann', default='')
parser.add_argument('--convert_v05', default='')
parser.add_argument('--minus1', action='store_true')
parser.add_argument('--plus1', action='store_true')
args = parser.parse_args()
print('Loading', args.ann)
data = json.load(open(args.ann, 'r'))
print('Done')
print('Loading', args.convert_v05)
data_v05 = json.load(open(args.convert_v05, 'r'))
cats_v05 = data_v05['categories']
catid2synset = {x['id']: x['synset'] for x in data['categories']}
synset2v05 = {x['synset']: x['id'] for x in cats_v05}
catid2v05 = {x['id']: synset2v05[catid2synset[x['id']]] \
for x in data['categories'] if catid2synset[x['id']] in synset2v05}
print('Loading', args.pred)
if args.pred.endswith('.pth'):
import torch
pred_data = torch.load(args.pred)
preds = []
# import pdb; pdb.set_trace()
for x in pred_data:
preds.extend(x['instances'])
else:
preds = json.load(open(args.pred, 'r'))
print('Done')
out_path = args.pred[:-5] + '_v05.json'
ret = []
for x in preds:
cat_id = x['category_id']
if args.minus1:
cat_id = cat_id - 1
if args.plus1:
cat_id = cat_id + 1
if cat_id in catid2v05:
cat_id = catid2v05[cat_id]
else:
continue
x['category_id'] = cat_id
ret.append(x)
print('Writing to', out_path)
json.dump(ret, open(out_path, 'w'))
from gtr.
Related Issues (20)
- how to train on one gpu HOT 2
- Which Detectron2 version should I install?
- about lvis version HOT 1
- produce results file on TAO test set HOT 1
- Your test dataset overlaps with the training dataset HOT 2
- CenterNet vs CenterNet2 HOT 2
- Difference between GTR_MOT_FPN and GTR_MOTFull_FPN HOT 1
- Question about inference resolution
- results_per_category only contains 296 classes during evaluation on TAO val set
- The choice of backbone on TAO
- OSError: [Errno 113] No route to host
- Can this project train with GTX3090 (24G)? I met out of memory HOT 2
- Failed on the long videos. HOT 1
- Question on Association Head ( FC Head)
- Arguments: Namespace(confidence_threshold=0.5, config_file='configs/quick_schedules/mask_rcnn_R_50_FPN_inference_acc_test.yaml', cpu=False, input=None, opts=[], output=None, video_input=None, webcam=None)
- test_conf0.json
- How to train my own dataset using GTR HOT 2
- gtr_roi_heads.py
- Webcam feature
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtr.