Skip to content

Commit

Permalink
Trying smaller image, but it's even slower cold starts so don't use it
Browse files Browse the repository at this point in the history
  • Loading branch information
KastanDay committed Feb 20, 2024
1 parent f0cb96e commit b8af589
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ai_ta_backend/modal/pest_detection_on_modal.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from modal import Secret, Stub, build, web_endpoint
import modal

# Simpler image, but slower cold starts: modal.Image.from_registry('ultralytics/ultralytics:latest-cpu')
image = (
modal.Image.debian_slim(python_version="3.10").apt_install("libgl1-mesa-glx", "libglib2.0-0")
# .run_commands(["apt-get install -y libgl1-mesa-glx libglib2.0-0 wget"])
Expand Down Expand Up @@ -132,7 +133,7 @@ async def predict(self, request: Request):
return err

def _detect_pests(self, image_paths: List[str]) -> List[Image.Image]:
"""I couldn't get the stupid types to work: -> List[Image.Image]"""
""" Run pest detection on the given images. """
# Run inference
results = self.model(image_paths) # results object with inference results

Expand Down

0 comments on commit b8af589

Please sign in to comment.