This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install necessary packages: | |
# pip install inference | |
# pip install supervision | |
from inference import InferencePipeline | |
import supervision as sv | |
import cv2 | |
import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{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', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |