Spaces:
Sleeping
Sleeping
Download model.py from Kazuyakaz/Sports_Classifier: direct link, hf CLI and curl.
- Browser
- Download file 286 Bytes
-
https://huggingface.co/spaces/Kazuyakaz/Sports_Classifier/resolve/main/model.py
- Command line
-
hf download hf://spaces/Kazuyakaz/Sports_Classifier/model.py
-
curl -L -o model.py https://huggingface.co/spaces/Kazuyakaz/Sports_Classifier/resolve/main/model.py
286 Bytes
| import torch | |
| import timm | |
| from torch import nn | |
| def create_sports_model(class_names=100): | |
| """sports100classのEfficientNetV2モデルを作成(timm使用)""" | |
| model = timm.create_model('efficientnetv2_rw_t.ra2_in1k', pretrained=True, num_classes=class_names) | |
| return model | |