Views
No views yet
1from deepforest import CropModel
2
3# Load model
4model = CropModel.load_model("ritesh313/neon-tree-resnet18-genus")
5
6# Use with DeepForest predictions
7# (after running detection with main DeepForest model)
8results = model.predict(image_crops)1import torch
2from safetensors.torch import load_file
3from torchvision import transforms
4
5# Load model weights
6state_dict = load_file("model.safetensors")
7
8# Load config for label mapping
9import json
10with open("config.json") as f:
11 config = json.load(f)
12
13# Create your model architecture and load weights
14# model.load_state_dict(state_dict)
15
16# Preprocessing
17preprocess = transforms.Compose([
18 transforms.Resize((224, 224)),
19 transforms.ToTensor(),
20 transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
21])1@software{neontreeclassification,
2 author = {Chowdhry, Ritesh},
3 title = {NeonTreeClassification: Multi-modal Tree Species Classification},
4 url = {https://github.com/Ritesh313/NeonTreeClassification},
5 year = {2026}
6}