Skip to content

Commit 9a1f0c5

Browse files
committed
feat: edit predict.py, keep model path for flexibility load the model #18
1 parent af7fb43 commit 9a1f0c5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

predict.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88

99
def predict_image(
1010
image_path: str = typer.Argument(help="image path", show_default=True),
11-
# model_path: str = typer.Argument("checkpoint_notebook.pth", help="model path (pth)", show_default=True),
12-
download: bool = typer.Argument(True, help="True for download the model automatically", show_default=True),
11+
model_path: str = typer.Argument(None, help="path to your model (pth)", show_default=True),
1312
device: str = typer.Argument("cpu", help="use cuda if your device has cuda", show_default=True)
1413
):
15-
predictor = ImageRecognition(download=download, device=device)
14+
predictor = ImageRecognition(model_path=model_path, device=device)
1615
result = predictor.predict(image=image_path)
1716
typer.echo(f"Prediction: {result}")
1817

0 commit comments

Comments
 (0)