Train a Custom YOLOS Transformer Model
This tutorial highlights the combination of a suite of best-in-class machine learning tools - Hugging Face Transformers, Roboflow, Weights and Biases, and AWS Sagemaker Serverless - to create a YOLOS object detection labeling, training, and deployment pipeline.
Roboflow Model Library (Model Zoo): YOLOS
The YOLOS model was proposed in You Only Look at One Sequence: Rethinking Transformer in Vision through Object Detection by Yuxin Fang, Bencheng Liao, Xinggang Wang, Jiemin Fang, Jiyang Qi, Rui Wu, Jianwei Niu, Wenyu Liu. YOLOS proposes to just leverage the plain Vision Transformer (ViT) for object detection, inspired by DETR. It turns out that a base-sized encoder-only Transformer can also achieve 42 AP on COCO, similar to DETR and much more complex frameworks such as Faster R-CNN. - https://huggingface.co/docs/transformers/main/en/model_doc/yolos
Roboflow, Hugging Face Transformers, Weights & Biases, and AWS Sagemaker Model Pipeline
Workflow:
- Install YOLOS Environment
- Gather and Label Our Dataset in Roboflow
- Download Our Dataset and Prepare Data For Training
- Configure Our YOLOS Model from Hugging Face Transformers; Hugging Face YOLOS listing || Original YOLOS Github Repository
- Run Custom YOLOS Training in PyTorch Lightning
- Visualize YOLOS Training in Weights and Biases
- Evaluate Custom YOLOS Model
- Visualize Test Inference
- Deploy YOLOS Model to AWS Sagemaker Serverless
- Sample images for Active Learning with Roboflow to improve our model
- Once you copy your dataset export code (export in COCO JSON format), continue on with the video tutorial to train and deploy your model
Train and Deploy YOLOS Transformer on a Custom Dataset (Roboflow Blog)
(with the help of Roboflow's python package for easy data management)
- YOLOS Model Training Notebook (Roboflow Model Zoo)
- YOLOS, GitHub Repository
Don't forget to save your model weights!