This model is built on the ResNet-18 CNN architecture and trained to distinguish film photographs from digital ones by analyzing differences in texture, color rendition, and overall visual characteristics. It...
Fuente del modelo
Descripción de la fuente
This model is built on the ResNet-18 CNN architecture and trained to distinguish film photographs from digital ones by analyzing differences in texture, color rendition, and overall visual characteristics. It designed to capture the subtle traits that make film photography unique, and achieves great classification performance.
pip install huggingface_hub
pip install torch torchvision
Fuentes
1 fuenteVerificado 28 sept
Artefactos del modelo
1 artefactoExtractos de fuentes
2 extractosfrom huggingface_hub import hf_hub_download
hf_hub_download(repo_id="chr1sggg/Film-Photo-Classification", filename="model.pth")
import torch
import torchvision
MODEL_PATH = "your_path"
DEVICE = "" #cuda / cpu / mps
model = torchvision.models.resnet18(weights=None)
model.fc = torch.nn.Linear(512, 2)
model.load_state_dict(
torch.load(MODEL_PATH, map_location=DEVICE)
)
model.to(DEVICE)
model.eval()
--- license: apache-2.0 base_model: - microsoft/resnet-18 pipeline_tag: image-classification --- # Film Photo Classifier This model is built on the ResNet-18 CNN architecture and trained to distinguish film photographs from digital ones by analyzing differences in texture, color rendition, and overall visual characteristics. It designed to capture the subtle traits that make film photography unique, and achieves great classification performance. # Demo # Installation 1. Install libs ``` pip install huggingface_hub pip install torch torchvision ``` 2. Download model ```python from huggingface_hub import hf_hub_download hf_hub_download(repo_id="chr1sggg/Film-Photo-Classification", filename="model.pth") ``` 3. Load Model ```python import torch import torchvision MODEL_PATH = "your_path" DEVICE = "" #cuda / cpu / mps model = torchvision.models.resnet18(weights=None) model.fc = torch.nn.Linear(512, 2) model.load_state_dict( torch.load(MODEL_PATH, map_location=DEVICE) ) model.to(DEVICE) model.eval() ```
Source context: 0 downloads · 0 likes · Pipeline image-classification · Repo chr1sggg/Film-Photo-Classification