Spaces:
Sleeping
Sleeping
Download model.py from Kazuyakaz/flower_classifier: direct link, hf CLI and curl.
- Browser
- Download file 278 Bytes
-
https://huggingface.co/spaces/Kazuyakaz/flower_classifier/resolve/main/model.py
- Command line
-
hf download hf://spaces/Kazuyakaz/flower_classifier/model.py
-
curl -L -o model.py https://huggingface.co/spaces/Kazuyakaz/flower_classifier/resolve/main/model.py
278 Bytes
| import torch | |
| import timm | |
| from torch import nn | |
| def create_flower_model(num_classes=14): | |
| """花分類用のEfficientNetB2モデルを作成(timm使用)""" | |
| model = timm.create_model('efficientnet_b2.ra_in1k', pretrained=True, num_classes=num_classes) | |
| return model | |