-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for remote zoo model parameters #201
base: main
Are you sure you want to change the base?
Conversation
plugins/zoo/__init__.py
Outdated
if Version(fo.__version__) >= Version("1.4.0"): | ||
if isinstance(zoo_model, foz.RemoteZooModel): | ||
obj = types.Object() | ||
zoo_model._get_parameters(ctx, obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why _get_parameters()
instead of get_parameters()
mostly curious...?
I would rather have:
zoo_inputs = zoo_model.resolve_input(ctx) # returns a types.Property()
Which would be more consistent IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to have consistency too, but the issue is that resolve_input()
returns a types.Property
while in this situation, we don't want to define an entire form but rather inject a few parameters into an existing form.
Note that we just shipped a similar pattern for EvaluationMetric operators. Example usage here.
I'm definitely open to alternatives here, including changing the interface for evaluation metrics. Just not sure what to do! What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I'm an idiot, we could just do this couldn't we 🤦
prop = zoo_model.resolve_input(ctx)
inputs.add_property("remote_params", prop)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requires voxel51/fiftyone#5439
Change log
The
@voxel51/zoo/apply_zoo_model
operator now automatically injects any custom parameters defined by remote zoo models into the operator's input form.Example usage
Applying a CLIP model from voxel51/openai-clip
Applying a YOLO world model from ultralytics-models
Output