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

Question - Object class mapping and number of classes in config #99

Open
ChristianIngwersen opened this issue Dec 2, 2024 · 2 comments

Comments

@ChristianIngwersen
Copy link

ChristianIngwersen commented Dec 2, 2024

Hi,

In the example the following is given

self.obj365_ids = [0, 5] # Person, Cars

is this the ordering that should be used consistently? I.e. the the mapping in src/data/dataset/coco_dataset.py -1?

Snippet from file

mscoco_category2name = {
    1: 'person',
    2: 'bicycle',
    3: 'car',
    4: 'motorcycle',
    5: 'airplane',
    6: 'bus',
    7: 'train',
    8: 'truck',
    9: 'boat',
    10: 'traffic light',
    11: 'fire hydrant',
    13: 'stop sign',

So if I have a custom dataset with e.g. trucks only I should specify:

self.obj365_ids = [7] # Truck

And then further in my custom_detection.yml config I would specify number of classes as being 2 as I will have two classes background and trucks? Is this correctly understood?

@Peterande
Copy link
Owner

Peterande commented Dec 5, 2024

It depends on whether the class starts at 0 or 1. If the ids in your dataset start at 1, you can remap them, or just set the class to 2 as you said. In the latter case, class0 is never used

@KhanMechAI
Copy link

Hey team, i've also been having some difficulty finetuning on a custom dataset (using the pre-trained obj365 weights, s model). In the docs it says that you can just use your new labels, but in practice, that doesnt seem to work very well. Should we try to line our classes up with the obj365 or coco classes as best we can? Some clarification or examples would be awesome

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