| license: mit | |
| pipeline_tag: image-classification | |
| tags: | |
| - image-classification | |
| - pytorch | |
| - appliances | |
| datasets: | |
| - GBooster/imclass-dataset | |
| # ImClass Model | |
| Классификатор изображений бытовой техники (5 классов): | |
| laptop, refrigerator, smartphone, tv, washing_machine | |
| ## Использование | |
| ```python | |
| from huggingface_hub import PyTorchModelHubMixin | |
| import torch.nn as nn | |
| from torchvision import models as tvm | |
| class ImClassModel(nn.Module, PyTorchModelHubMixin): | |
| def __init__(self, num_classes=5): | |
| super().__init__() | |
| base = tvm.resnet18(weights=None) | |
| base.fc = nn.Linear(base.fc.in_features, num_classes) | |
| self.model = base | |
| def forward(self, x): | |
| return self.model(x) | |
| model = ImClassModel.from_pretrained("GBooster/imclass-model") | |
| model.eval() | |
| ``` | |
| ## Обучающие данные | |
| Модель обучена на [GBooster/imclass-dataset](https://huggingface.co/datasets/GBooster/imclass-dataset). | |