-
Notifications
You must be signed in to change notification settings - Fork 1
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
Added yolov7 into the sahi model.py #1
base: inference
Are you sure you want to change the base?
Conversation
@kimb3rlyn change the camel case to snake case leh. Class names are still okay |
scripts/inferenceSahi.py
Outdated
model = Yolov7DetectionModel( | ||
image_size = 1280, | ||
model_path = weightPath, | ||
config_path = cfgPath | ||
) | ||
|
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.
expose some more parameters here so people know what are the main things to change
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.
These are the main parameters to change. The rest are optional on the model
category_remapping: Optional[Dict] = None, | ||
load_at_init: bool = True, | ||
image_size: int = None, | ||
bgr: bool = False, |
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.
is there a point to expose this then if sahi uses PIL? will there be a situation where we need this to be true?
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.
For future development maybe; where SAHI no longer user PIL ? cause is still under development
Add sahi into requirements.txt, maybe update readme on how to use too |
Completed |
Found a potential bug in yolov7/yolov7/utils/sahiModelExtended.py Line 287 in fafbf8f
currently it is using the prediction results from detect_get_box_in(). However, this function already has NMS applied to results before the merging. Think it should be something more similar to https://github.com/obss/sahi/blob/33e215019519869936a997718bcba404a63d28f6/sahi/models/yolov5.py#L53 instead, so we can perform NMS after merging the results |
except Exception as e: | ||
raise TypeError("Error loading model yolov7 : ", e) | ||
|
||
def perform_inference(self, image: np.ndarray): |
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.
bump! @yhsmiley @kimb3rlyn would like to use this hehehe |
Added yolov7 into SAHI model
Need to pip install SAHI library first before using