lvis-dataset / lvis-api

Python API for LVIS Dataset
http://lvisdataset.org
Other
408 stars 63 forks source link

Can LVIS achieve the following coco functions to evaluate Class-agnostic results on lvis? #34

Closed Z-MU-Z closed 2 years ago

Z-MU-Z commented 2 years ago

❓ Questions and Help

https://github.com/NVlabs/FreeSOLO/blob/main/LICENSE FreeSOLO use this function to evaluate on coco, but seemingly lvis don‘t have .loadRes,

from pycocotools.coco import COCO from pycocotools.cocoeval import COCOeval

annType = 'segm' prefix = 'instances' print('Running demo for {} results.'.format(annType))

dataDir='datasets/coco/' dataType='val2017' annFile = '{}/annotations/{}_{}.json'.format(dataDir,prefix,dataType) cocoGt=COCO(annFile)

resFile = 'training_dir/FreeSOLO_pl/inference/coco_instances_results.json'

resFile = 'demo/instances_val2017_densecl_r101.json'

cocoDt=cocoGt.loadRes(resFile)

cocoEval = COCOeval(cocoGt,cocoDt,annType) cocoEval.params.useCats = 0 cocoEval.evaluate() cocoEval.accumulate() cocoEval.summarize()