🚀 DETR (End-to-End Object Detection) model with ResNet-50 backbone fine-tuned on chess pieces
The DETR model is trained end-to-end on a chess pieces recognition dataset, offering a solution for object detection in the context of chess.
🚀 Quick Start
Use the code below to get started with the model:
from transformers import DetrImageProcessor, DetrForObjectDetection
import torch
from PIL import Image
import requests
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
processor = DetrImageProcessor.from_pretrained("aesat/detr-finetuned-chess", revision="no_timm")
model = DetrForObjectDetection.from_pretrained("facebook/detr-finetuned-chess", revision="no_timm")
inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)
target_sizes = torch.tensor([image.size[::-1]])
results = processor.post_process_object_detection(outputs, target_sizes=target_sizes, threshold=0.9)[0]
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
box = [round(i, 2) for i in box.tolist()]
print(
f"Detected {model.config.id2label[label.item()]} with confidence "
f"{round(score.item(), 3)} at location {box}"
)
✨ Features
The DETR model is an encoder - decoder transformer with a convolutional backbone. Two heads are added on top of the decoder outputs for object detection: a linear layer for class labels and a MLP (multi - layer perceptron) for bounding boxes. It uses object queries to detect objects in an image, with each query looking for a particular object. For COCO, the number of object queries is set to 100.
📚 Documentation
Model Details
Model Description
The DETR model is an encoder - decoder transformer with a convolutional backbone. Two heads are added on top of the decoder outputs in order to perform object detection: a linear layer for the class labels and a MLP (multi - layer perceptron) for the bounding boxes. The model uses so - called object queries to detect objects in an image. Each object query looks for a particular object in the image. For COCO, the number of object queries is set to 100.
Property |
Details |
Developed by |
[More Information Needed] |
Funded by [optional] |
[More Information Needed] |
Shared by [optional] |
[More Information Needed] |
Model Type |
[More Information Needed] |
Language(s) (NLP) |
[More Information Needed] |
License |
[More Information Needed] |
Finetuned from model [optional] |
[More Information Needed] |
Model Sources [optional]
- Repository: [More Information Needed]
- Paper [optional]: [More Information Needed]
- Demo [optional]: [More Information Needed]
Uses
How To Use
The code example above demonstrates how to use the model for object detection without fine - tuning or plugging into a larger ecosystem/app.
Downstream Use [optional]
[More Information Needed]
Out - of - Scope Use
[More Information Needed]
Bias, Risks, and Limitations
[More Information Needed]
Recommendations
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
Training Details
Training Data
[More Information Needed]
Training Procedure
Preprocessing [optional]
[More Information Needed]
Training Hyperparameters
- Training regime: [More Information Needed]
Speeds, Sizes, Times [optional]
[More Information Needed]
Evaluation
Testing Data, Factors & Metrics
Testing Data
[More Information Needed]
Factors
[More Information Needed]
Metrics
[More Information Needed]
Results
[More Information Needed]
Summary
Model Examination [optional]
[More Information Needed]
Environmental Impact
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
Property |
Details |
Hardware Type |
[More Information Needed] |
Hours used |
[More Information Needed] |
Cloud Provider |
[More Information Needed] |
Compute Region |
[More Information Needed] |
Carbon Emitted |
[More Information Needed] |
Technical Specifications [optional]
Model Architecture and Objective
[More Information Needed]
Compute Infrastructure
Hardware
[More Information Needed]
Software
[More Information Needed]
Citation [optional]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
Glossary [optional]
[More Information Needed]
More Information [optional]
[More Information Needed]
Model Card Authors [optional]
[More Information Needed]
Model Card Contact
[More Information Needed]