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

Demo code #8

Closed
bhack opened this issue Sep 21, 2017 · 13 comments
Closed

Demo code #8

bhack opened this issue Sep 21, 2017 · 13 comments

Comments

@bhack
Copy link

bhack commented Sep 21, 2017

Seems that all the API requires always the GT cause also the test code works with datasets.
Do you have a minimal demo code to just visually evaluate results on new images from internet?

@fastlater
Copy link

fastlater commented Sep 22, 2017

@bhack you can check the loader.py and set it to load the images from a different folder (folder created by you with new images from internet) or load a single image.

The minimal demo code should looks like:

def main(argv=None):
  
    net = ResNet(config=net_config, depth=50, training=False)

    loader = HERE YOU SET THE FOLDER OR IMAGE
    
    with tf.Session(config=tf.ConfigProto(allow_soft_placement=True,
                                          log_device_placement=False)) as sess:

        detector = Detector(sess, net, loader, net_config, no_gt=args.no_seg_gt)
        detector.restore_from_ckpt(args.ckpt)

        #HERE, Use methods in detector.py to get the results 



if __name__ == '__main__':
    tf.app.run()

I haven't write an entire script to test a single image but it should not be too complicated if you read the test.py and detector.py

@dvornikita
Copy link
Owner

Thanks, @fastlater. It's true that you can modify the loader and also turn off evaluation. But ideally, it should be easier than that.
I guess @bhack has the point there. I probably should provide some demo code to work with arbitrary images. I'm gonna make it and let you know when I push it.

@fastlater
Copy link

@dvornikita We will be happy to see a clean demo code from you in the future. Just for testing, I created a new loader and used the functions from detector.py. It was a little bit dirty the code but at least, I got the desired output.

@dvornikita
Copy link
Owner

@bhack, @fastlater, @AlonTetro, the demo has arrived.
Be careful, there are some minor changes in detector.py, so check them if you don't want to pull the new version.

@bhack
Copy link
Author

bhack commented Sep 27, 2017

Thank you. Is the demo working with BlitzNet512?

@fastlater
Copy link

@dvornikita Thank you for letting me know. I will take a look on it.

@dvornikita
Copy link
Owner

@bhack it does. The only difference with testing is that you don't have a dataset linked to the loader. Just specify the right flags for running the demo as you would do for testing.
The only limitation for now is Pascal VOC categories. I'll push the COCO labels later.

@bhack
Copy link
Author

bhack commented Sep 27, 2017

@dvornikita I've asked cause with BlitzNet512 I got tensorflow.python.framework.errors_impl.NotFoundError: Key ssd_back/block_rev6/shortcut/weights not found in checkpoint
Edit: I missed to post that the solution was to add --image_size 512 arg for the BlitzNet512 model

@bhack
Copy link
Author

bhack commented Sep 27, 2017

@dvornikita Results seems goods. I've noted generally that MSCOCO And PASCAL GT segmentation masks are not so precise. Have you tried to add also Davis dataset masks 2016 and 2017 to the training mix?

@dvornikita
Copy link
Owner

@bhack No we didn't. The strength of the method is to discover some hidden correlations in bounding boxes and segmentation annotations to reduce class confusion for both and make localization of boxes more precise, while still being realtime. I guess the Davis dataset has only segmentations and if you want them more accurate it would make more sense to use a state-of-the art segmentation method.
But we may make good use of this dataset in the future. Thanks.

@bhack
Copy link
Author

bhack commented Sep 27, 2017

@dvornikita Yes I understand the original scope. But I still think that Blitznet segmentation quality is quite good. I think is not a problem to derive a bounding box from a segmentation Mask like in the Mscoco API official toolkit.

@dvornikita
Copy link
Owner

dvornikita commented Sep 28, 2017

@bhack I looked closer at the Davis and I agree with you, it's feasible. For sure it can be used at least as a solid pretraining.
Although there might be a problem of video and still image statistics mismatch, which is considered to be an issue in the community. So it needs to be done carefully.

@bhack
Copy link
Author

bhack commented Sep 28, 2017

@dvornikita The interesting thing is to evaluate how the quality of the mask influence the segmentation performance of your model. So probably one of the first interesting approach is just to fine-tune on Davis the models that you have already pretrained.

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

3 participants