Implementation of DETR: End-to-End Object Detection with Transformers in PyTorch. In this repo, I have used DETR model and yolo models on real-time video stream. Currently, Yolo is commonly used in real-time object detection application. DETR is a new model architecture (shown bellow) for object detection that uses transformers. Please refer to this blog post for further information.
The server.py uses datasets from webcam / ip camera or video file. This information can be changed in server.py dataclass.
@dataclass
class Config:
source: str = "assets/walking_resized.mp4"
view_img: bool = False
model_type: str = "detr_resnet50"
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
skip: int = 1
yolo: bool = True
yolo_type = "yolov8n.pt"
First, install the requirements:
pip install -r requirements.txt
Then, run the server:
python server.py
First, build the docker image:
docker build -t detr-vision .
Then, run the docker container:
docker run -it --rm --name detr-vision-container detr-vision
Run with docker-compose:
docker-compose up --build
stop the container with docker-compose:
docker-compose down