My Model Card
usage example. replace model name and model_id according to the referring repository weights.
from torchvision import models
from huggingface_hub import PyTorchModelHubMixin
import torch.nn as nn
class HF_Wrapper(nn.Module, PyTorchModelHubMixin):
def __init__(self, model_name="resnet18", num_classes=10000):
super().__init__()
self.model = getattr(models, model_name)(num_classes=num_classes)
def forward(self, x):
return self.model(x)
model_id = "totti0223/resnet18_fractaldb_10000"
model_name = "resnet18"
num_classes = 10000
model = HF_Wrapper(model_name, num_classes=num_classes).from_pretrained(model_id)
model.eval()
# normalization
from torchvision import transforms
normalize = transforms.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225))
val_transform = transforms.Compose([transforms.Resize((224,224), interpolation=2),transforms.ToTensor(), normalize])
FractalDB Pretrained Models for PyTorch via PyTorchModelHubMixin
The original work is done by Hirokatsu Kataoka et al.
Original repository: https://github.com/hirokatsukataoka16/FractalDB-Pretrained-ResNet-PyTorch
License: MIT
Citation: @article{KataokaIJCV2022, author = {Kataoka, Hirokatsu and Okayasu, Kazushige and Matsumoto, Asato and Yamagata, Eisuke and Yamada, Ryosuke and Inoue, Nakamasa and Nakamura, Akio and Satoh, Yutaka}, title = {Pre-training without Natural Images}, journal = {International Journal of Computer Vision (IJCV)}, year = {2022} }
@inproceedings{KataokaACCV2020, author = {Kataoka, Hirokatsu and Okayasu, Kazushige and Matsumoto, Asato and Yamagata, Eisuke and Yamada, Ryosuke and Inoue, Nakamasa and Nakamura, Akio and Satoh, Yutaka}, title = {Pre-training without Natural Images}, booktitle = {Asian Conference on Computer Vision (ACCV)}, year = {2020} }
I, Yosuke Toda, the uploader of this repo do not appeal any rights against this model. Yosuke Toda yosuke@phytometrics.jp