Closed iurisilvio closed 1 month ago
@capjamesg I see you added typing to local
in 4d863a24fde0722f41d895e7c4dc08490bfa565b.
Do you know how these local
flags are used? I don't know exactly what change I should do here, maybe just change to local: Optional[str]
.
I think it should beOptional[str]
. Here's an example of documentation where this function is used, and the type is a str: https://docs.roboflow.com/api-reference/inference#local-deploy-inference
The original intent for the function may have been to trigger between two modes, but then changed to support a URL since someone may choose to run Inference locally on a non-standard port?
Hum.. makes sense! Maybe it should be str | bool
and for True
we set api to localhost. I'll dig deeper in old commits to understand.
I found initial implementation. https://github.com/roboflow/roboflow-python/commit/61a84d41224fe191ee4e5616b3657122aaa072b4
The value is defined as optional string and passed downstream. https://github.com/roboflow/roboflow-python/blob/4558646857f1d543a57332b6eb267439dd1834b9/roboflow/core/project.py#L287
I'll check why mypy don't give me a better error and fix it.
local
is defined as bool but later is used as base api url.ClassificationModel
InstanceSegmentationModel
KeypointDetectionModel
ObjectDetectionModel
Mypy errors that highlighted the issue: