facebookresearch / hiera

Hiera: A fast, powerful, and simple hierarchical vision transformer.
Apache License 2.0
870 stars 39 forks source link

how to change number of classes from kinetics to other multiclass dataset? #21

Closed mbilalshaikh closed 1 year ago

mbilalshaikh commented 1 year ago

In the inference notebook. It is only suitable for kinetics-based datasets. Does Hiera library accepts different number for classes types?

dbolya commented 1 year ago

Yep, just specify num_classes=<n> when initializing the model. If you're using torch hub, just pass it is an argument in addition to the others.

Of course, if you change the number of classes while using a pre-trained model, the last layer's weights will get reset--so you'll have to finetune it on your classes yourself.