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

Added yolov7 into the sahi model.py #1

Open
wants to merge 17 commits into
base: inference
Choose a base branch
from
Open

Added yolov7 into the sahi model.py #1

wants to merge 17 commits into from

Conversation

kimb3rlyn
Copy link
Collaborator

Added yolov7 into SAHI model
Need to pip install SAHI library first before using

@kimb3rlyn kimb3rlyn requested a review from yhsmiley September 12, 2022 06:32
@kimb3rlyn kimb3rlyn marked this pull request as draft September 12, 2022 06:36
@kimb3rlyn kimb3rlyn changed the title Added yolov7 package into the sahi model.py Added yolov7 into the sahi model.py Sep 12, 2022
@kimb3rlyn kimb3rlyn marked this pull request as ready for review September 19, 2022 10:36
@yhsmiley
Copy link
Owner

yhsmiley commented Sep 21, 2022

@kimb3rlyn change the camel case to snake case leh. Class names are still okay

Comment on lines 19 to 24
model = Yolov7DetectionModel(
image_size = 1280,
model_path = weightPath,
config_path = cfgPath
)

Copy link
Owner

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

Copy link
Collaborator Author

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,
Copy link
Owner

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?

Copy link
Collaborator Author

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

@yhsmiley
Copy link
Owner

Add sahi into requirements.txt, maybe update readme on how to use too

@kimb3rlyn
Copy link
Collaborator Author

Add sahi into requirements.txt, maybe update readme on how to use too

Completed

@ernestlwt
Copy link

Found a potential bug in

def perform_inference(self, image: np.ndarray):

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):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tehwenyi
Copy link

bump! @yhsmiley @kimb3rlyn would like to use this hehehe

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

Successfully merging this pull request may close these issues.

4 participants