Downloads · 30 days
17
3% of all-time downloads
frgfm/cspdarknet53_mish
cspdarknet53_mish is a image classification model from frgfm. Use it when you need a label for an image. It is set up for transformers. The card lists the license as apache-2.0.
Pretrained on ImageNette. The CSP-Darknet-53 Mish architecture was introduced in this paper.
Downloads · 30 days
17
3% of all-time downloads
All-time downloads
632
Public
Repo size
213 MB
Likes
0
Public
Click a slice to open those files.
.bin107 MB · 100%
From the Hugging Face model README
Pretrained on ImageNette. The CSP-Darknet-53 Mish architecture was introduced in this paper.
The core idea of the author is to change the convolutional stage by adding cross stage partial blocks in the architecture and replace activations with Mish.
Python 3.6 (or higher) and pip/conda are required to install Holocron.
You can install the last stable release of the package using pypi as follows:
pip install pylocron
or using conda:
conda install -c frgfm pylocron
Alternatively, if you wish to use the latest features of the project that haven't made their way to a release yet, you can install the package from source (install Git first):
git clone https://github.com/frgfm/Holocron.git
pip install -e Holocron/.
from PIL import Image
from torchvision.transforms import Compose, ConvertImageDtype, Normalize, PILToTensor, Resize
from torchvision.transforms.functional import InterpolationMode
from holocron.models import model_from_hf_hub
model = model_from_hf_hub("frgfm/cspdarknet53_mish").eval()
img = Image.open(path_to_an_image).convert("RGB")
# Preprocessing
config = model.default_cfg
transform = Compose([
Resize(config['input_shape'][1:], interpolation=InterpolationMode.BILINEAR),
PILToTensor(),
ConvertImageDtype(torch.float32),
Normalize(config['mean'], config['std'])
])
input_tensor = transform(img).unsqueeze(0)
# Inference
with torch.inference_mode():
output = model(input_tensor)
probs = output.squeeze(0).softmax(dim=0)
Original paper
@article{DBLP:journals/corr/abs-1911-11929,
author = {Chien{-}Yao Wang and
Hong{-}Yuan Mark Liao and
I{-}Hau Yeh and
Yueh{-}Hua Wu and
Ping{-}Yang Chen and
Jun{-}Wei Hsieh},
title = {CSPNet: {A} New Backbone that can Enhance Learning Capability of {CNN}},
journal = {CoRR},
volume = {abs/1911.11929},
year = {2019},
url = {http://arxiv.org/abs/1911.11929},
eprinttype = {arXiv},
eprint = {1911.11929},
timestamp = {Tue, 03 Dec 2019 20:41:07 +0100},
biburl = {https://dblp.org/rec/journals/corr/abs-1911-11929.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
Source of this implementation
@software{Fernandez_Holocron_2020,
author = {Fernandez, François-Guillaume},
month = {5},
title = {{Holocron}},
url = {https://github.com/frgfm/Holocron},
year = {2020}
}