GithubHelp home page GithubHelp logo

num_classes about up-detr HOT 6 CLOSED

dddzg avatar dddzg commented on July 22, 2024
num_classes

from up-detr.

Comments (6)

dddzg avatar dddzg commented on July 22, 2024

I think you are right.
But, if you set num_classes to 1 you should change

labels.append(1)

this line to 0.
Because, the last class is designed for no-object category.

from up-detr.

rgbd-zml avatar rgbd-zml commented on July 22, 2024

I think you are right. But, if you set num_classes to 1 you should change

labels.append(1)

this line to 0.
Because, the last class is designed for no-object category.

Thanks for your reply!
If the num_classes is set to 1, this means that the label-0 represents the object class and the label-1 represents the non-object category in the classification cost?

from up-detr.

dddzg avatar dddzg commented on July 22, 2024

Yes. So, in our code, label-0 is never used.

from up-detr.

rgbd-zml avatar rgbd-zml commented on July 22, 2024

Yes. So, in our code, label-0 is never used.

Hi, I have also a confusion about the paper. There is a explanation in up-detr paper:
up-detr-paper
In this paper , label-1 represents the object category(matching). There are some differences between the code and the paper. I'm not sure when num_classes is set to 1, which one of label-0 and label-1 represents object category(matching)?

from up-detr.

dddzg avatar dddzg commented on July 22, 2024

I am sorry for the inconsistency.
In our paper, 0 represents no-obj, 1 represents obj.
In our code, 1 represents obj, 2 represents no-obj. (0 is nerver used, and there is 3 class num in total)

self.class_embed = nn.Linear(hidden_dim, num_classes + 1)

Check here for the loss calculation.

up-detr/models/detr.py

Lines 124 to 126 in be066df

target_classes = torch.full(src_logits.shape[:2], self.num_classes,
dtype=torch.int64, device=src_logits.device)
target_classes[idx] = target_classes_o

If you set num classes to 1,
0 represents obj, 1 represents no-obj.

The last class always represents the no-obj in our code.

from up-detr.

rgbd-zml avatar rgbd-zml commented on July 22, 2024

I get it! Thank you very much!

from up-detr.

Related Issues (20)

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.