Skip to content

Instantly share code, notes, and snippets.

View decent-engineer-decent-datascientist's full-sized avatar

decent-engineer-decent-datascientist

View GitHub Profile
@decent-engineer-decent-datascientist
decent-engineer-decent-datascientist / client.py
Last active May 24, 2022 04:45
Quick FastAPI wrapper for yolov5
import requests as r
import json
from pprint import pprint
# Images
dir = 'https://github.com/ultralytics/yolov5/raw/master/data/images/'
imgs = [dir + f for f in ('zidane.jpg', 'bus.jpg')] # batched list of images
# Send images to endpoint
res = r.post("http://localhost:9999/inference", data=json.dumps({'img_list': imgs}))