Requirements.txt using TensorFlow-2.3.0 + Use a training model TF-2.x compatible + Let setup.py be distribution aware #1
Conversation
…5 appropriate to TensorFlow-2.x.
…5 appropriate to TensorFlow-2.x.
…5 appropriate to TensorFlow-2.x.
microfaune/detection.py
Outdated
| """Release GPU memory.""" | ||
| self._model = None | ||
|
|
||
| if __name__ == '__main__' : |
There was a problem hiding this comment.
We don't want to execute the file but provide the methods: people would import the package and use the methods.
So we can remove this part.
| # | ||
| # NB_2: | ||
| # https://stackoverflow.com/questions/63277123/what-is-use-feature-2020-resolver-error-message-with-jupyter-installation-on | ||
| # We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default. |
There was a problem hiding this comment.
Did you generate it using pip freeze? I think some of the packages are used in the microfaune/microfaune repo but not in the package so we'll not include them.
| * Run the commands<br/> | ||
| Generate the distribution `python3 setup.py sdist bdist_wheel`<br/> | ||
| Upload the distribution `twine upload dist/*` | ||
|
|
There was a problem hiding this comment.
I think we want to keep the readme for users of the package so no need to explain how to generate a distribution? What do you think?
There was a problem hiding this comment.
Actually if we keep "how to generate the distribution", this would be helpful for the team members of this season and the next ones.
Just notice that in order to be able to perform the real upload, we should already have knowledge of the SECRETS that are private, so there no risk to keep things as they are unless you identified other issues with that.
…media file positive annotation
| # detector = RNNDetector() | ||
| # global_score, local_score = detector.predict_on_wav(os.path.abspath(os.path.join(os.path.dirname(__file__), "media/SWIFT_20190723_050006.wav"))) # NB: Check that loaded wav file actually exists on your disk | ||
| # print(f"Golbal score: {global_score} - Localscore: {local_score}") | ||
|
|
There was a problem hiding this comment.
Let's try to avoid commented code.
| # validator = RNNDetectorValidator(detector) | ||
| # # metrics = validator.computeMetricsAgainstAnnotatedFile( os.path.abspath(os.path.join(os.path.dirname(__file__), "media-annotation/SWIFT_20000101_022052.json")) ) | ||
| # metrics = validator.computeMetricsAgainstAnnotatedDirectory( os.path.abspath(os.path.join(os.path.dirname(__file__), "media-annotation")) ) | ||
| # print(f'Total METRICS : {metrics}') No newline at end of file |
There was a problem hiding this comment.
I think the validation could be outside of the package for now. We can work on this in https://github.com/microfaune/microfaune
| # 3 - Check that the last index did't exceed the prediction size | ||
| if negative_tuples_ndexes[-1][0] > len(predictions) - 1 : | ||
| negative_tuples_ndexes.pop() | ||
| return negative_tuples_ndexes No newline at end of file |
There was a problem hiding this comment.
Same as the previous comment: let's put validation in https://github.com/microfaune/microfaune
| # | ||
| # NB_2: | ||
| # https://stackoverflow.com/questions/63277123/what-is-use-feature-2020-resolver-error-message-with-jupyter-installation-on | ||
| # We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default. |
-- python3 setup.py sdist bdist_wheel # Generate a distribution
-- twine upload dist/* # Upload the distribution