lpo icon indicating copy to clipboard operation
lpo copied to clipboard

Simple python example

Open colincsl opened this issue 9 years ago • 15 comments

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!

colincsl avatar May 26 '15 21:05 colincsl

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).

rodrigob avatar Jun 01 '15 01:06 rodrigob

Will this be like -i (and the image directory)? How do I use that flag? @rodrigob

ksivakumar avatar Aug 05 '15 19:08 ksivakumar

it can be -i /some/directory/*.png.

philkr avatar Aug 07 '15 04:08 philkr

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 ?

ganarajpr avatar Sep 05 '15 11:09 ganarajpr

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.

philkr avatar Sep 05 '15 12:09 philkr

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

ganarajpr avatar Sep 05 '15 12:09 ganarajpr

python propose_hf5.py -bi ~/Documents/imagedl/images/ffc24661-57e1-4d79-aeca-7cce7b80dbc2.png ../models/lpo_VOC_0.05.dat output.hf5

philkr avatar Sep 05 '15 12:09 philkr

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?

mbahacker avatar Sep 13 '15 17:09 mbahacker

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.

colincsl avatar Sep 13 '15 20:09 colincsl

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

mbahacker avatar Sep 15 '15 10:09 mbahacker

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.

colincsl avatar Sep 15 '15 12:09 colincsl

@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.

colincsl avatar Sep 17 '15 15:09 colincsl

Thanks Colin ! I was able to use the hfd5 files. Thanks for your inputs they helped !!

mbahacker avatar Sep 19 '15 05:09 mbahacker

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?

tsingtaogemini avatar Jun 21 '16 05:06 tsingtaogemini

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

rodrigob avatar May 16 '17 09:05 rodrigob