Git Product home page Git Product logo

learningtocountanything's People

Contributors

mahobley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

learningtocountanything's Issues

Counting on images is outside the dataset

Hello. Thank you for this valuable work.
I want to do some tests on my own images and have the result of counting and heatmap images. Currently, according to the guide, I can only test on the images in the dataset. Please help, thanks

Generating density maps after training doesnt work

So I've been testing this model for a few days and I am still not able to replicate the results. The density maps overlapped in the pictures for qualitative results doesn't turn out as good as in the paper, nor it doesn't work on all the images.

I trained the model with the example_training config, obtaining multiple 'ckpt' files, which I chose the one I think fitted the best (I don't really have a way to decide the best checkpoint since all of them have similar results with the validation set). Then I run the example_localisation_training with said checkpoint and use the generated ckpt (again, one of the generated checkpoints) to run the example_localisation_vis config, expecting good qualitative results.

Have to say, when I run the example_test with the checkpoint from the training, the results are quite similar to the one on the paper:
'test/loss': 0.3367506265640259,
'test_DDP_MAE': 15.221793174743652,
'test_DDP_RMSE': 53.706050872802734
In the paper the results for the test set are MAE = 14.23 and RMSE = 43.83.

But for some reason using that checkpoint for the visualization generate bad results, compared to the ones on the paper. Even more, not all the images generated have a density/heatmap overlapped. Only half of them generate a density map on them, the rest are in grey-scale. I know this is wrong because when I used the "example weights" provided for FSC-133 (counting.ckpt and localisation.ckpt) all the images turned out well, so even if I trained the model wrong, I don't understand why all the images aren't overlapped with a density map.

This is the result of one of the pictures with the example weights provided:
val_7260_loc

This is the result for the same image I got after training the model by myself:
val_7260_loc

And this is one example of many of a picture that did not generate a density map:
train_79_loc

So maybe im following the steps wrong? should I consider a different kind of configuration?

'VisionTransformer' object has no attribute 'dist_token'

When I fully follow the README file, when I run the py file, I report the following error“'VisionTransformer' object has no attribute 'dist_token' ”, how can I solve this.as follows:

Traceback (most recent call last):
File "main.py", line 102, in
main()
File "main.py", line 42, in main
model = CountingAnything(CFG)
File "/home/hao/桌面/LearningToCountAnything/models/CountingAnything.py", line 47, in init
self.backbone = ViTExtractor(vit_config)
File "/home/hao/桌面/LearningToCountAnything/models/backbone_vit.py", line 29, in init
self.create_from_base_model(
File "/home/hao/桌面/LearningToCountAnything/models/backbone_vit.py", line 47, in create_from_base_model
self.dist_token = base_model.dist_token
File "/root/anaconda3/envs/LearningToCountAnything/lib/python3.8/site-packages/torch/nn/modules/module.py", line 947, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'VisionTransformer' object has no attribute 'dist_token'

Understanding the ckpts

@victorprad @mahobley
1)could you please help understand why do we have two checkpoitns. localisation & counting.ckpt
2) If we have to train on custom dataset, do we have to use both the ckpts ?

  1. during inference which ckpt has to be used localisation or counting ?

  2. What is the difference between the self.CFG["resume_counting_head_path"], and self.resume path

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.