Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inference code not working #7

Closed
karan-shr opened this issue Feb 19, 2020 · 12 comments
Closed

inference code not working #7

karan-shr opened this issue Feb 19, 2020 · 12 comments

Comments

@karan-shr
Copy link

Hi,
I wanted to test the code by running inference on a couple of samples images i downloaded from the internet. But it's not working. Here are the steps that i followed:

  1. cloned repo and setup the conda environment. Note: since there were compatibility issues between tf 1.13 and python 3.5, I used python version 3.6.
  2. created a subdirectory in the repo called data/pretrained_weights and downloaded the resnet50 related ckpt files from GDrive into the directory. That is, the files resnet50_v1d.ckpt.data-00000-of-00001 , resnet50_v1d.ckpt.index and resnet50_v1d.ckpt.meta.
  3. ran the inference code on a folder containing the following two images:
    1. image_1.
    2. image_2.
  4. the images generated in the destination folder don't contain any bounding boxes.

Am I doing something wrong? Could you please guide. Thanks in advance.

@yangxue0827
Copy link
Member

pretrained_weights is used for training. you need download trained weights in MODEL_ZOO.md @karan-shr

@karan-shr
Copy link
Author

@yangxue0827 thanks for the reply.

Okay so this is what I did:

  1. Downloaded the weights for for R3Det with ResNet50_v1d backbone from the link provided in MODELZOO.md doc. Extracted the files and placed them under the output/trained_weights folder. The four files are

    1. checkpoint
    2. DOTA_1079996model.ckpt.data-00000-of-00001
    3. DOTA_1079996model.ckpt.index
    4. DOTA_1079996model.ckpt.meta
  2. The data/pretrained_weights contain all the files provided in your Gdrive link mentioned in point 2 of your documentation.

  3. The tools/inference.py script uses the standard config file (configs/cfgs.py), so I didn't modify that. Then I ran the inference.py script again and then I got the same result as last time, no bounding boxes.

@yangxue0827
Copy link
Member

refer here
@karan-shr

@yangxue0827
Copy link
Member

image
@karan-shr

@yangxue0827
Copy link
Member

I updated inference.py and you need to download the script again. @karan-shr

@karan-shr
Copy link
Author

Hi @yangxue0827,

Based on your feedback, did the following:

  1. Did a git-pull to get the latest version of the inference.py and other changes into the my local repo.
  2. changed the folder structure for the weights as you have mentioned in the figure above.

Sadly, still no bounding boxes. Can you please test on the images i had mentioned in the first comment. Just to compare.

Thanks for the feedback so far.

Regards,
Karan

@yangxue0827
Copy link
Member

my model is trained by DOTA dataset. which is very different from your images, so no results are normal. Maybe you need to retrain a model with your own data. @karan-shr

@karan-shr
Copy link
Author

Yes, i know the images are different. But in this case the bounding box should be wrongly placed, or over- or under-segment. But getting no bounding boxes on an image is also not normal.

Ofcourse, I can retrain the model. But first to determine the efficacy of the code, I am trying your inference code with some simple examples. It should work, shouldn't it? Does the inference script work for you?

@yangxue0827
Copy link
Member

Why not use the dota dataset for inference and use the test_dota_r3det.py script.

@ncdejito
Copy link

ncdejito commented Jun 2, 2020

applied tools/inference.py on DOTA Test set 2 images, still no bounding boxes. Adjusted libs/configs/cfgs.py VIS_SCORE to 0.0, still no bounding boxes.

Here's the code I used
python inference.py --data_dir '/dir/of/2/test/images/' --save_dir '/my/chosen/folder/' --gpu 0 --draw_imgs

Here's the output running inference script on DOTA Test set P0034.png
image

@2018loveyyq
Copy link

I also encountered the same problem when running test_dota_r3det.py, and I have placed the file location according to the author's instructions, has your problem been solved?

@2018loveyyq
Copy link

image
I printed out the test results and found that they were all empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants