Species Classifier

Classify forest species from macroscopic wood images using pre-trained YOLO models. Run directly in your browser or download the models to use locally.

Online classifier

Classify in your browser

Select a model, upload a macroscopic wood image, and get results instantly. All processing runs on your device — no data is sent to any server.

Species classifier
448×448 px · sliding window · majority voting
Select a model to begin
Click "Select model" above to choose one of the 15 available architectures
Local usage

Run with Python

Request the .pt models above and run the full pipeline locally. Extract 448×448 patches via sliding window, classify each patch, then use majority voting for the final result.

1
Install dependencies
terminal
$ pip install ultralytics opencv-python numpy
2
Extract 448×448 patches (sliding window)
extract_patches.py
import cv2

def extract_patches(image_path, size=448, overlap=0.0):
    img = cv2.imread(image_path)
    h, w = img.shape[:2]
    step = int(size * (1.0 - overlap))
    patches = []
    for y in range(0, h - size + 1, step):
        for x in range(0, w - size + 1, step):
            patches.append(img[y:y+size, x:x+size])
    return patches
3
Classify each patch and majority vote
classify_and_vote.py
from ultralytics import YOLO
from collections import Counter

model = YOLO("yolo26m-cls.pt")

votes = []
for patch in patches:
    r = model.predict(patch, verbose=False)[0]
    votes.append(r.names[r.probs.top1])

species, n = Counter(votes).most_common(1)[0]
print(f"Result: {species} ({n}/{len(votes)} patches)")
Back to project