-
Notifications
You must be signed in to change notification settings - Fork 20
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
Comments
Hi. Yes, the idea is really great! At the moment, I’m not entirely sure how to implement something like this and write documentation for it. I think it would be worth creating a separate class in I’d be really grateful if you could help with creating this and assist with writing documentation at the end of the file: |
Sounds good, I'll look into it. Cheers. |
@Koldim2001 I ended up going a different route for my needs, so unsure if the above feature request really applies (or is needed). Essentially I broke up some of the methods in element_crops = MakeCropsDetectThem(
image=img,
model=YOLO("yolov8n.pt"),
segment=False,
show_crops=False,
shape_x=300,
shape_y=300,
overlap_x=50,
overlap_y=50,
conf=0.5,
iou=0.7,
batch_inference=True,
show_processing_status=True,
)
# Perform the crops
element_crops.make_crops()
# Get the crops, make preedictions
results = model.predict(element_crops.get_crops())
# Detect objects
element_crops.detect_them(results)
# Combine the detections
result = CombineDetections(element_crops, nms_threshold=0.05) The model in this example is still provides a ultralytics |
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 withYOLO-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:
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 ofSAHI
, where they are model agnostic, and only need the results come out assupervision.Detections
.The text was updated successfully, but these errors were encountered: