Giter Site home page Giter Site logo

zhanggongjie / sam-detr Goto Github PK

View Code? Open in Web Editor NEW
291.0 11.0 50.0 1.92 MB

[CVPR'2022] SAM-DETR & SAM-DETR++: Official PyTorch Implementation

License: MIT License

Python 72.10% Shell 3.25% C++ 2.23% Cuda 22.42%
pytorch object-detection detr computer-vision transformer detection vision-transformer deep-learning vision machine-learning

sam-detr's People

Contributors

zhanggongjie 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sam-detr's Issues

import errrors on different versions of pytorch and visualize qustions

First of all, thx for your opensource code!

Known issues

There are some errors with your import in attention.py
1.

if float(torch.__version__[:3]) < 1.7:
   from torch._overrides import has_torch_function, handle_torch_function
else:
  from torch.overrides import has_torch_function, handle_torch_function

It seems quite simple, but when torch.version returns like 1.11.0, this could lead to version error, as float(torch.version[:3]) < 1.7 will return 1.1<1.7 True.
I recommand you could split torch.version return by '.' to compare version more precisely.
2. and if pytorch version >=1.8.1

from torch.nn.modules.linear import  _LinearWithBias

will lead to import error, as _LinearWithBias seems not accessable in pytorch>=1.8.1, where can be replaced by

from torch.nn.modules.linear import NonDynamicallyQuantizableLinear as _LinearWithBias

I'll appreciate it if you could add version compatability like above with this too

My question

I'm new to cv so, forgive me if my question is easy.
After training on my own dataset, I get many .pth files in my output directory, I think it contains model parameters.
I want to know that having trained model parameters, how could I load this model to detect on 1 specific image.
That's to say, I want to give the model an image, and get back model's detection result in some format.
Thx if you could reply.

How to introduce DN-DETR denoising method into SAM-DETR?

Thanks for the wonderful work.
I have seen that DN is introduced into SAM-Deter ++, but there is no corresponding disclosure code. Could you briefly describe the method if it is convenient? Can I just replace the input from the Decoder with something like a DN?
thank you

Generalized Box IoU consistently reporting degenerate boxes

Hello. First off, thank you for making your work's code available here on GitHub. It is well organized and maintained.

My question is, since I have tried applying your SAM-DETR model to my custom object detection dataset for training and validation, I am consistently seeing the generalized_box_iou utility function raise AssertionErrors saying the model's predicted bounding boxes are degenerate as the (lx, ly) coordinates are greater than the (rx, ry) coordinates (this check makes sense to me, however, I am not sure how to solve the issue). I have also added a check on the len(boxes1) > 0 to make sure at least one box was predicted in a batch of images.

def generalized_box_iou(boxes1, boxes2):

Would you have any ideas why the model would be predicting degenerate bounding box coordinates from time to time, ending training prematurely?

swin transformer backbone

hi. Can I use Swin Transformer as a backbone instead of resnet50? If so, what changes should be made to the swin transformer(pretrained on imgnet22k) ?

how the reference box works?

I want to know how the reference box works,why they can locate the object to be detected precisely?
That is important to me,thank you very much!

No results in detecting

Thanks for your great work.
When I run the code "bash scripts/r50_smca_e12_4gpu.sh", I get an error "FileNotFoundError: [Errno 2] No such file or directory: 'data/coco/train2017/000000151988.jpg'". Thus, I add one line "--eval" into "scripts/r50_smca_e12_4gpu.sh", and I run again. And I can successfully run the code. But get none results like this:
image
image

How to draw a heatmap for decoder?

Hello,

Thanks for your great work.
Excuse me, but I'm interested in how to get a heat map of a decoder like Figure 4 mentioned in the paper.
Can you provide a visual script?
Thank you!

Data preparation mistake

Hey!It's me again, I forgot to tell u another small mistake in Data Preparation

code_root/
└── data/
    └── coco/
        ├── train2017/
        ├── val2017/
        └── annotations/
        	├── instances_train2017.json
        	└── instances_val2017.json

This does not seem to meet the file structure written in your code.
The correct Tree seems to be like this:

code_root/
└── data/
    └── coco/
        └── images/
               ├── train2017/
               └──val2017/
        └── annotations/
        	├── instances_train2017.json
        	└── instances_val2017.json

Please check it out, thx

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.