Closed b10112157 closed 6 years ago
Can you please try to run the example from the original repository https://github.com/tylin/coco-caption, namely by getting:
and then running the provided notebook: cocoEvalCapDemo.ipynb
Does the code work then? Maybe your results.json is not in the correct format?
ok ,i can try it . my python is py3.5. the project can run the py35?
sorry i run this project . but get some error. how to solve it the problem?
You have to use the current project for Python 3 support not the original one.
So you have to do the following on a clean directory:
from pycocotools.coco import COCO
from pycocoevalcap.eval import COCOEvalCap
dataDir = '.'
dataType = 'val2014'
algName = 'fakecap'
annFile = '%s/annotations/captions_%s.json'%(dataDir,dataType)
resFile = '%s/results/captions_%s_%s_results.json'%(dataDir,dataType,algName)
coco = COCO(annFile)
cocoRes = coco.loadRes(resFile)
cocoEval = COCOEvalCap(coco, cocoRes)
cocoEval.params['image_id'] = cocoRes.getImgIds()
cocoEval.evaluate()
in the step 1: command line in cocoapi/pythonAPI "python setup.py build_ext --inplace" and "python setup.py build_ext install" Is it the correct procedure? but show output that
I seems like you don’t have a C++ compiler installed or it's not in your PATH environment variable because the error comes from not finding cl.exe.
i command python setup.py install now it can "import pycocotools " in the step 2, i put the bleu、cider 、metor 、rough、tokenizer 、eval.py .in the folder pycocoevalcap. and clone "\annotations\captions_val2014.json" and "\results\captions_val2014_fakecap_results.json"
and run this code but show that .
thanks i already use it , i forget install java
Then I assume the issue is resolved.
i use captions_val2014.json,but bleu value wrong . how to solve it.?
gts = tokenizer.tokenize(gts) i try "print (gts) in eval.py",but show the {458755: ['']} my equip is py 3.5.4,and tf 1.4.0