lpo
lpo copied to clipboard
Simple python example
It's great that you made easy-to-use code to evaluate on multiple datasets. However, I'm having a little trouble evaluating on individual images for my own application.
Could you make a simple python example showing how to use this library for evaluating on an individual image?
Thanks!
I think propose_hf5.py
has what you are looking for.
One the input options is -i A List of images to evaluate
, from what I can see the images path is arbitrary (e.g. not VOC or COCO).
Will this be like -i (and the image directory)? How do I use that flag? @rodrigob
it can be -i /some/directory/*.png
.
I am attempting this
python propose_hf5.py -ib ~/Documents/imagedl/images/ffc24661-57e1-4d79-aeca-7cce7b80dbc2.png ../models/lpo_VOC_0.05.dat
Traceback (most recent call last): File "propose_hf5.py", line 61, in <module> prop.load(args.model_name) AssertionError: Assertion "n == PROP_MAGIC" failed in /home/ganaraj/lpo/lib/proposals/lpo.cpp:61
I am getting the following error ? Anything I need to set ?
try: python propose_hf5.py -bi ~/Documents/imagedl/images/ffc24661-57e1-4d79-aeca-7cce7b80dbc2.png ../models/lpo_VOC_0.05.dat
Your command tried to load an image named b and used the png as a model file, which it wasn't. This triggered the assertion.
python propose_hf5.py -bi ~/Documents/imagedl/images/ffc24661-57e1-4d79-aeca-7cce7b80dbc2.png ../models/lpo_VOC_0.05.dat
usage: propose_hf5.py [-h] [-b] [-bb] [-bo] [-d DATASET] [-i IMAGES [IMAGES ...]] model_name save_path propose_hf5.py: error: too few arguments
Now I get too few arguments
python propose_hf5.py -bi ~/Documents/imagedl/images/ffc24661-57e1-4d79-aeca-7cce7b80dbc2.png ../models/lpo_VOC_0.05.dat output.hf5
Hi Phil,
I guess, this works for a data set which is defined already i.e. lpo_VOC_0.05.dat. How do I generate my own dataset for my particular models?
This might not be what you're looking for, but here is the script I made for visualizing LPO on a video: https://gist.github.com/colincsl/abd3564d3e95ace2591b. You could easily modify it to take in a directory of images.
Thanks ! I was able to generate the proposal file i.e. *.hf5. I am trying to use these proposals in fast-rcnn but not being able to load them like .mat proposals. Were you able to do that? Any help would be appreciated
Yeah I got it running with fast-rcnn but (temporarily) abandoned because it wasn't working on my surgical data.
The code is on my other computer. The ICRA deadline is tonight so I might not be able to get to it until tomorrow. After that, I'll upload the code as soon as I can.
@mbahacker It looks like I saved the LPO bounding boxes as a set of mat files instead of as hfd5. I think it was straightforward once I figured out how the bounding boxes were supposed to be stored. I did this around a month ago as a throw away experiment... sorry I don't remember more of the details.
Thanks Colin ! I was able to use the hfd5 files. Thanks for your inputs they helped !!
python propose_hf5.py -bi ~/Desktop/im1.png ../models/lpo_VOC_0.05.dat ~/Desktop/output.hf5
I also got too few argument error, my goal is to generate proposal for voc2007 test data. Could anyone help me?
Using
python propose_hf5.py ../models/lpo_VOC_0.05.dat ~/Desktop/output.hf5 -b -i ~/Desktop/im1.png
solved the "too few arguments" error for me on python3.4