Skip to content

Instantly share code, notes, and snippets.

@808Code
808Code / video_rfdetr_inference.py
Last active October 11, 2025 20:19
Running Object Detection on Videos Using RF-DETR with the Inference package
# Install necessary packages:
# pip install inference
# pip install supervision
from inference import InferencePipeline
import supervision as sv
import cv2
import numpy as np
@808Code
808Code / image_rfdetr_inference.py
Last active October 11, 2025 20:01
Running Object Detection on Images Using RF-DETR with the Inference package
# Install necessary packages:
# pip install inference
# pip install supervision
from inference import get_model
model = get_model("rfdetr-base")
from PIL import Image
image = Image.open("test_image.jpg")
@808Code
808Code / ms_coco_classnames.txt
Created October 11, 2025 07:58 — forked from AruniRC/ms_coco_classnames.txt
Class Names of MS-COCO classes in order of Detectron dict
{0: u'__background__',
1: u'person',
2: u'bicycle',
3: u'car',
4: u'motorcycle',
5: u'airplane',
6: u'bus',
7: u'train',
8: u'truck',
9: u'boat',
@808Code
808Code / async_to_sync.py
Created December 1, 2024 15:53
Use synchronous wrapper to consume an asynchronous generator
import asyncio
# Example asynchronous generator with parameters
async def example_async_gen(start, end, delay=1):
"""
Asynchronous generator that yields numbers from start to end with a delay.
:param start: Starting number (inclusive).
:param end: Ending number (exclusive).
:param delay: Delay in seconds between yields.