Skip to content
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

Feature Request: Thoughts on CustomModel template class? #32

Open
Jordan-Pierce opened this issue Jan 18, 2025 · 0 comments
Open

Feature Request: Thoughts on CustomModel template class? #32

Jordan-Pierce opened this issue Jan 18, 2025 · 0 comments

Comments

@Jordan-Pierce
Copy link
Contributor

What are your thoughts on having a sort of CustomModel template class that would mostly serve as an example for others to follow such that it would allow them to create their own model to be used with YOLO-Patch-Based-Inference, instead of using a ultralytics-provided model (yolo, fastsam, rtdetr)?

This library uses ultralytics models, but only for making detections in one line of code. But if someone wanted to use their own model, all they really need to do is wrap it in a custom class than ensures that it has the following:

from ultralytics.engine import Results

class CustomModel:
    model.names = ...
    ...
    def predict( batch, imgsz, conf, iou, classes, verbose, extra_args):
        # Make predictions
        # Process predictions
        results = Results(...)    # processed predictions, in ultralytics Results format 
        return results

This would expand the use of the library for others who cannot use ultralytics due to commercial licenses (though, I think technically the dependency of Results still means that it cannot be used by those folks, but one thing at a time I guess).

For reference, this is similar to supervision's implementation of SAHI, where they are model agnostic, and only need the results come out as supervision.Detections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant