/ Модель

Характеристики

Лицензия
CC BY-SA 4.0
Опубликована
5 ноя 2026

deepfaune-vit_large_patch16_dinov3.lvd1689m

Классификация изображенийИзображение → label3 профессии

Модель DeepFaune классифицирует изображения животных по видам и предназначена для анализа снимков дикой природы.

158скачиваний за 30 дней0лайковвеса обновлены24 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Модель классификации изображений, обученная инициативой DeepFaune для распознавания видов животных по фотографиям. В карточке приведены результаты проверки на отложенной выборке для классов, включая бизона и барсука; для некоторых классов тестовых примеров нет. Модель подходит для автоматической сортировки снимков дикой природы и анализа фотоловушек. Веса распространяются по лицензии CC BY-SA 4.0: при использовании необходимо указать авторство и сослаться на DeepFaune.

Сценарии применения

  • определение вида животного на фотографии
  • сортировка снимков с фотоловушек по видам
  • подготовка выборок изображений дикой природы для анализа

Ограничения

Для класса горного козла в таблице нет тестовых примеров, поэтому качество на отложенной выборке для него не оценено. При распространении или использовании весов требуется указание авторства и ссылка на DeepFaune согласно CC BY-SA 4.0.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

This model was trained by the DeepFaune initiative.

Performances

We measured the performance (recall per class) of the classification model:

ClassesOut-of-sample TestOut-of-sample Test SupportTraining Support
bison / bison99,89%460456951
badger / blaireau98,10%7490110525
ibex / bouquetinNA010918
beaver / castor98,57%707542
red deer / cerf97,77%126686370657
golden jackal / chacal doré89,39%239410449
chamois / chamois97,07%5674139071
cat / chat97,81%2226363646
goat / chèvre79,06%12376442
roe deer / chevreuil98,57%63557484170
dog / chien95,75%242254548
raccoon dog / chien viverrin92,27%55619099
fallow deer / daim94,30%1176244446
squirrel / écureuil98,93%242628598
moose / élan97,41%637261257
equid / équidé90,53%296643051
genet / genette97,27%2524917
wolverine / glouton92,94%54653494
hedgehog / hérisson95,38%65718
lagomorph / lagomorphe99,16%1798076669
wolf / loup97,10%238337136
otter / loutre100,00%22325
lynx / lynx99,90%104710741
mongoose / mangouste100,00%23616
marmot / marmotte94,88%14852338
micromammal / micromammifère97,27%40335596
mouflon / mouflon88,97%78484758
sheep / mouton99,24%6546197586
mustelid / mustélidé97,94%583631782
bird / oiseau99,65%57884213822
bear / ours96,09%373213091
porcupine / porc-épic97,59%5819319
nutria / ragondin88,18%7701303
muskrat / rat musqué75,00%241444
racoon / raton laveur93,56%1141960071
fox / renard97,43%49444254662
arctic fox / renard arctique94,37%8746336544
reindeer / renne98,84%51811906
wild boar / sanglier99,05%172129292876
cow / vache98,16%7647148429

### Minimal inference code

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import cv2
import requests
import timm
import torch
import torch.nn as nn
from PIL import Image
from torchvision.transforms import InterpolationMode, transforms

classes = ['bison', 'badger', 'ibex', 'beaver', 'red deer', 'golden jackal',
           'chamois', 'cat', 'goat', 'roe deer', 'dog', 'raccoon dog',
           'fallow deer', 'squirrel', 'moose', 'equid', 'genet', 'wolverine',
           'hedgehog', 'lagomorph', 'wolf', 'otter', 'lynx', 'mongoose',
           'marmot', 'micromammal', 'mouflon', 'sheep', 'mustelid', 'bird',
           'bear', 'porcupine', 'nutria', 'muskrat', 'raccoon', 'fox',
           'arctic fox', 'reindeer', 'wild boar', 'cow']

# Important: DeepFaune is fine-tuned at 224x224 (rather than DINOv3's default 256x256)
# for faster inference with equivalent accuracy.
CROP_SIZE = 224

def cropSquareCVtoPIL(imagecv, box):
    # cropped PIL image, as squared as possible (rectangle if close to the borders)
    x1, y1, x2, y2 = box
    xsize = (x2 - x1)
    ysize = (y2 - y1)
    if xsize > ysize:
        y1 = y1 - int((xsize - ysize) / 2)
        y2 = y2 + int((xsize - ysize) / 2)
    if ysize > xsize:
        x1 = x1 - int((ysize - xsize) / 2)
        x2 = x2 + int((ysize - xsize) / 2)
    height, width, _ = imagecv.shape
    croppedimagecv = imagecv[max(0, int(y1)):min(int(y2), height), max(0, int(x1)):min(int(x2), width)]
    croppedimage = Image.fromarray(croppedimagecv[:, :, (2, 1, 0)]) # converted to PIL RGB image
    return croppedimage


class Model(nn.Module):
    def __init__(self):
        super().__init__()
         # Important: the model is trained with global_pool = 'token'
         # (i.e. using the class token for final classification). 
         # This is not the default behavior with timm's dinov3 and thus 
         # should be specified when using timm.create_model:
        self.base_model = timm.create_model("vit_large_patch16_dinov3.lvd1689m",
                                            pretrained=False, 
                                            num_classes=40,
                                            global_pool="token")
        self.transforms = transforms.Compose([
            transforms.Resize(size=(CROP_SIZE, CROP_SIZE), interpolation=InterpolationMode.BICUBIC, max_size=None, antialias=None),
            transforms.ToTensor(),
            transforms.Normalize(mean=[0.4850, 0.4560, 0.4060], std=[0.2290, 0.2240, 0.2250])])


    def loadWeights(self, path, device):
        params = torch.load(path, weights_only=False, map_location=device)
        self.load_state_dict(params['state_dict'])


if __name__ == "__main__":
    device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

    # Loading the model
    model = Model().to(device)
    model.loadWeights("deepfaune-vit_large_patch16_dinov3.lvd1689m.pt", device=device)
    model.eval()

    # Downloading a test image
    img_data = requests.get("https://huggingface.co/spaces/DeepFaune/README/resolve/main/chamois1.JPG", timeout=10).content
    with open('chamois1.JPG', 'wb') as f:
        f.write(img_data)

    # Loading the image and cropping using bounding box coordinates in xyxy format
    imagecv = cv2.imread("chamois1.JPG")
    box = [0.0, 76.54496002197266, 436.7752990722656, 714.8261108398438]
    crop = cropSquareCVtoPIL(imagecv, box)

    # Preprocessing
    preprocessed_crop = model.transforms(crop).unsqueeze(0).to(device)

    # Inference
    with torch.inference_mode():
        embeddings = model.base_model.forward_features(preprocessed_crop)
        logits = model.base_model.forward_head(embeddings)
        scores = logits.softmax(dim=1).cpu().numpy()

        best_idx = scores[0].argmax()
        print(classes[best_idx], scores[0, best_idx]) # chamois 0.9999325

Licensing

DeepFaune software is released under the CeCILL license, compatible with GNU GPL.

Our model weights are distributed under CC BY-SA 4.0 license not allowing using them without citing and referencing the name DeepFaune.

Please cite DeepFaune whenever you use it.

@article{rigoudy_deepfaune_2023,
	title = {The DeepFaune initiative: a collaborative effort towards the automatic identification of European fauna in camera trap images},
	url = {https://doi.org/10.1007/s10344-023-01742-7},
	doi = {10.1007/s10344-023-01742-7},
	journal = {European Journal of Wildlife Research},
	author = {Rigoudy, Noa and Dussert, Gaspard and Benyoub, Abdelbaki and Besnard, Aurélien and Birck, Carole and Boyer, Jérome and Bollet, Yoann and Bunz, Yoann and Caussimont, Gérard and Chetouane, Elias and Carriburu, Jules Chiffard and Cornette, Pierre and Delestrade, Anne and De Backer, Nina and Dispan, Lucie and Le Barh, Maden and Duhayer, Jeanne and Elder, Jean-François and Fanjul, Jean-Baptiste and Fonderflick, Jocelyn and Froustey, Nicolas and Garel, Mathieu and Gaudry, William and Gérard, Agathe and Gimenez, Olivier and Hemery, Arzhela and Hemon, Audrey and Jullien, Jean-Michel and Knitter, Daniel and Malafosse, Isabelle and Marginean, Mircea and Ménard, Louise and Ouvrier, Alice and Pariset, Gwennaelle and Prunet, Vincent and Rabault, Julien and Randon, Malory and Raulet, Yann and Régnier, Antoine and Ribière, Romain and Ricci, Jean-Claude and Ruette, Sandrine and Schneylin, Yann and Sentilles, Jérôme and Siefert, Nathalie and Smith, Bethany and Terpereau, Guillaume and Touchet, Pierrick and Thuiller, Wilfried and Uzal, Antonio and Vautrain, Valentin and Vimal, Ruppert and Weber, Julian and Spataro, Bruno and Miele, Vincent and Chamaillé-Jammes, Simon},
	year = {2023}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

Не удалось определить, чем загружать веса модели (нет library_name и architectures).

Ревизия весов
4a2ba9f

0 моделей