Downloads · 30 days
3
2% of all-time downloads
bsustersic/wood-identifier-resnet18
wood-identifier-resnet18 is a image classification model from bsustersic. 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.
This is a fine-tuned ResNet-18 model for identifying wood species from images.
Downloads · 30 days
3
2% of all-time downloads
All-time downloads
183
Public
Parameters
11.2M
269 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors44.8 MB · 100%
From the Hugging Face model README
This is a fine-tuned ResNet-18 model for identifying wood species from images.
The model can identify the following 16 wood species:
This model is designed to identify wood species from images. It can be used via the HuggingFace Inference API or downloaded for local inference.
import requests
from PIL import Image
import io
API_URL = "https://api-inference.huggingface.co/models/bsustersic/wood-identifier-resnet18"
headers = {"Authorization": "Bearer YOUR_HF_TOKEN"}
def identify_wood(image_path):
with open(image_path, "rb") as f:
data = f.read()
response = requests.post(API_URL, headers=headers, data=data)
return response.json()
# Example usage
predictions = identify_wood("wood_sample.jpg")
print(predictions)
from transformers import AutoImageProcessor, AutoModelForImageClassification
from PIL import Image
processor = AutoImageProcessor.from_pretrained("bsustersic/wood-identifier-resnet18")
model = AutoModelForImageClassification.from_pretrained("bsustersic/wood-identifier-resnet18")
image = Image.open("wood_sample.jpg")
inputs = processor(image, return_tensors="pt")
outputs = model(**inputs)
predictions = outputs.logits.softmax(dim=1)
# Get top prediction
predicted_class = predictions.argmax().item()
confidence = predictions[0][predicted_class].item()
print(f"Predicted: {model.config.id2label[predicted_class]} ({confidence:.2%})")
This model achieves good accuracy on wood species identification tasks. Performance may vary depending on:
bsustersic
For questions or issues, please open an issue on the model repository.