javiribera / locating-objects-without-bboxes

PyTorch code for "Locating objects without bounding boxes" - Loss function and trained models
Other
249 stars 52 forks source link

running locate.py without xml file #6

Closed ofirliba closed 4 years ago

ofirliba commented 5 years ago

when I don't have xml file its fail in at line 93, data_plant_stuff.py when trying to read None file :

    # Read all XML as a string
    with open(os.path.join(directory, xml_filename), 'r') as fd:
        xml_str = fd.read()
javiribera commented 5 years ago

Can you provide the entire error stack? You shouldn't be creating a XMLDataset instance if you don't have an XML file.

OscarPangMQ commented 5 years ago

Hi, @javiribera thank you so much for your work. Excellent. I met a problem when running the code. Please allow me to explain what I did.

  1. Following your suggestions, I conda a new environment with all required packages.
  2. conda activate object-locator.
  3. I downloaded the Pupil dataset with 2135 images and .txt labels.
  4. I downloaded your pretrained model --pupil,lambdaa=1,BS=64,SGD,LR1e-3,p=-1,ultrasmallNet .ckpt
  5. I test it with: python -m object-locator.locate --dataset pupilDataset/ --out output/ --model pupil_pretrained_NET where pupil_pretrained_NET is equal to pupil,lambdaa=1,BS=64,SGD,LR1e-3,p=-1,ultrasmallNet.ckpt

Note that I know there is a mistake about .txt labels, I just use word to change it into .xml file without dealing with the coordinates of x=x/2, y=288-y/2. Here I just want to test the performance of each test image, not evaluate it with GT although I also do not know how to change it into standard .xml file for use.

So, the problem exists when I run it as follows: E: 'charmap' codec can't decode byte 0x9d in position 815938: character maps to

Only this output, can you give me some guidances? thanks a lot.

javiribera commented 5 years ago

I don't understand how you generated your XML file but anyhow, you should not have any XML file. The groundtruth of your dataset should be in CSV as described here https://engineering.purdue.edu/~sorghum/dataset-plant-centers-2016

The code assumes that your dataset has the groundtruth in CSV format. Creating this CSV file involves manual work that is not described in this repo because it is problem-specific.

OscarPangMQ commented 5 years ago

yeah, here I used Pupil dataset to test the performance. The label from it is only a .txt file.

Anyway, I mean I just care the results fo locating Pupil on each image and do not need to compare the results with groundtruth.

However, I do not run it correctly. There is an error as I showed above when I followed your steps.

Thanks.

javiribera commented 5 years ago

This is going to be really hard to debug without the error stack trace.

javiribera commented 4 years ago

Closing this issue because of inactivity. Feel free to reopen if you're still getting the error and please provide the error stack trace.