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/remove ultralytics #98

Conversation

MateoLostanlen
Copy link
Member

The goal of this PR is to get rid of the ultralytics repo and all its dependencies with a class that allows to perform inference directly from the onnx model

@MateoLostanlen MateoLostanlen added the type: enhancement New feature or request label Jul 26, 2022
@MateoLostanlen MateoLostanlen requested review from a team July 26, 2022 20:13
@MateoLostanlen MateoLostanlen self-assigned this Jul 26, 2022
@codecov
Copy link

codecov bot commented Jul 27, 2022

Codecov Report

Merging #98 (40c5676) into develop (0090320) will increase coverage by 3.30%.
The diff coverage is 79.01%.

@@             Coverage Diff             @@
##           develop      #98      +/-   ##
===========================================
+ Coverage    62.29%   65.60%   +3.30%     
===========================================
  Files            5        7       +2     
  Lines          183      250      +67     
===========================================
+ Hits           114      164      +50     
- Misses          69       86      +17     
Flag Coverage Δ
unittests 65.60% <79.01%> (+3.30%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pyroengine/engine/__init__.py 100.00% <ø> (ø)
pyroengine/models/utils.py 71.18% <71.18%> (ø)
pyroengine/engine/engine.py 51.47% <100.00%> (ø)
pyroengine/models/__init__.py 100.00% <100.00%> (ø)
pyroengine/models/yolov5.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us.

Copy link
Member

@frgfm frgfm left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

I think we could do a few modifications to get something really neat :)


y = self.session.run(["output"], {"images": x.numpy()})[0]

output = non_max_suppression(torch.tensor(y), self.conf_thres)[0].numpy()
Copy link
Member

Choose a reason for hiding this comment

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

do we need to convert it back to a pytorch tensor?

Can't we do it with numpy? I'd suggest implementing the utils in pure numpy to get rid of PyTorch & torchvision. (onnx works with numpy either way, not Pytorch tensors)

@MateoLostanlen
Copy link
Member Author

This is not relevant anymore after #101

@MateoLostanlen MateoLostanlen deleted the feature/remove_ultralytics branch October 2, 2022 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants