Running on CPU or GPU?
InsectSAM: Insect Segmentation and Monitoring
40
•
140
Apache-2.0
Image Segmentation
PyTorch
English
Opened about 2 months ago
by @drift-5638
5
@middle-32372 months ago
It works on CPU, just slower. Since the pipeline runs two models (GroundingDINO then SAM), each image takes noticeably longer than a single-model task. Fine for a few images, not great for hundreds.
@carter-22112 months ago
Resizing very large photos before inference helps in my experience. Also, if you’re processing many images, note that the sample code loads the models inside the function, so every call reloads them. Restructuring it to load once would save a lot of time.
@brian-ai-68992 months ago
+1 on loading once. I wrapped it in a small loop script and the difference was big.
The model card says a CUDA GPU is optional. I only have a laptop without a dedicated GPU. Is it usable for a handful of images, or is it painful?