{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreieftbexlzuopcq5d72wdn5gbb37jeokkzmp2owdftgioragicqxdq",
"uri": "at://did:plc:pgryn3ephfd2xgft23qokfzt/app.bsky.feed.post/3mmuc6s4jnxv2"
},
"path": "/t/yololite-via-pip-install/176265#post_1",
"publishedAt": "2026-05-27T18:12:29.000Z",
"site": "https://discuss.huggingface.co",
"tags": [
"YoloLite"
],
"textContent": "Heya!\n\nI posted several months back about my personal project YoloLite. I wanted to share some recent updates that have been done around my project. I have now decided to launch and upgrade directly via pip. You can test it out right now with a simple `pip install yololite.`This time around the models also do support instance segmentation.\n\nEverything is still Apache 2.0 and this time around I pretrained the models on the offical COCO-minitrain 25k dataset. The weights are automatically downloaded from GitHub on demand.\n\nYou can either use the API directly via Python or run everything via the CLI:\n\n\n yololite mode=predict model=yololite_cs3_m.pt source=test.jpg conf=0.4 save=True\n yololite mode=train model=yololite_mnv4_s.pt data=\"data.yaml\" epochs=30 workers=4\n\n\nI have pretrained a total of 9 models across 3 different lightweight backbones:\n\n * **CS3Darknet backbone:** `yololite_cs3_n.pt` | `yololite_cs3_s.pt` | `yololite_cs3_m.pt`\n\n * **MobileNetV4 backbone:** `yololite_mnv4_n.pt` | `yololite_mnv4_s.pt` | `yololite_mnv4_m.pt`\n\n * **HGNetV2 backbone:** `yololite_hg2_n.pt` | `yololite_hg2_s.pt` | `yololite_hg2_m.pt`\n\n\n\n\nCurrently supported export formats include **ONNX** and **TensorRT**. The framework also supports post-export validation to ensure stability and mAP consistency after deployment.\n\nEXAMPLES:\n\nfrom yololite import YoloLite\n\n#Add task=“seg” to enable segmentation\n\nmodel = YoloLite(r\"yololite_hg2_m.pt\")\n\n#train model. Data.yaml follow yolov8 standard.\n\nmodel.train(data=“data.yaml”, epochs=50, workers=4, batch=8, accumulate=4)\n\nmodel.train(data=“data.yaml”, epochs=50, workers=4, batch=8, accumulate=4, task=“seg”)\n\n#predict with the model\n\nres = model.predict(source=“image_video_or_np.array”, conf=0.4, iou=0.6, device=“cuda”)[0]\n\n#Export to tensorrt fp 16\n\nengine_path_16 = model.export(format=“engine”, half=True)\n\n#Export to tensorrt fp32\n\nengine_path_32 = model.export(format=“engine”)\n\n#Export to onnx (decoded)\n\nonnx_model = model.export(format=“decoded”)\n\n#Export onnx with built in nms\n\nonnx_nms = model.export(format=“decoded_nms”)\n\n#load one of the exported models\n\nmodel = YoloLite(onnx_nms)\n\n#run predict with the newly exported onnx model on a mp4 and save the results to a new mp4 file\n\nresults = model.predict(source=r\"Video Project.mp4\", device=“cuda”, draw=True, save=True)[0]\n\n#evaluate exported model, summary will be saved to runs/eval\n\nval = model.val(data=“data.yaml”, split=“test”)\n\n**NOTICE** : The documentation and presentation of this project is lacking, however feel free to test the models out and decide for yourself if its fun or not. Im not claiming any SOTA titels or anythings, this is a hobby project and nothing more.",
"title": "Yololite via pip install"
}