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

How to select which classes to detect on pretrained model? #11700

Open
SFSimDev opened this issue May 9, 2024 · 0 comments
Open

How to select which classes to detect on pretrained model? #11700

SFSimDev opened this issue May 9, 2024 · 0 comments
Assignees

Comments

@SFSimDev
Copy link

SFSimDev commented May 9, 2024

Hi,

I'm using the pretrained rtmdet-r_l_syncbn_fast_2xb4-aug-100e_dota model to scan some images and check for just one type of class.

I only want to detect one of the many classes it is trained on. How can I do that within my code?

def prepare_inference():

    config_file = 'models/rtmdet-r_l_syncbn_fast_2xb4-aug-100e_dota.py'
    checkpoint_file = 'models/rtmdet-r_l_syncbn_fast_2xb4-aug-100e_dota_20230224_124735-ed4ea966.pth'

    model = init_detector(config_file, checkpoint_file, device='cuda:0')  # or device='cuda:0'
    return model

def start_inference(model, file):

    result = inference_detector(model, file)

Thanks for any help you can give.

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

2 participants