tau-fibrils-yolo 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,119 @@
1
+ name: Publish, Build and Release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ tags:
8
+ - "v*"
9
+ pull_request:
10
+ branches:
11
+ - main
12
+ workflow_dispatch:
13
+
14
+ permissions:
15
+ contents: write
16
+
17
+ jobs:
18
+ deploy:
19
+ runs-on: ubuntu-latest
20
+ if: contains(github.ref, 'tags')
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v4
25
+ with:
26
+ python-version: "3.9"
27
+ - name: Install dependencies
28
+ run: |
29
+ python -m pip install --upgrade pip
30
+ pip install -U setuptools setuptools_scm wheel twine build
31
+ - name: Build and publish
32
+ env:
33
+ TWINE_USERNAME: __token__
34
+ TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
35
+ run: |
36
+ git tag
37
+ python -m build .
38
+ twine upload dist/*
39
+
40
+ build:
41
+ needs: deploy
42
+ runs-on: ${{ matrix.os }}
43
+ strategy:
44
+ matrix:
45
+ os: [windows-latest]
46
+
47
+ env:
48
+ PYAPP_PROJECT_NAME: 'tau_fibrils_yolo'
49
+
50
+ steps:
51
+ - name: Checkout code
52
+ uses: actions/checkout@v2
53
+
54
+ - name: Install Rust
55
+ uses: actions-rs/toolchain@v1
56
+ with:
57
+ toolchain: stable
58
+ override: true
59
+
60
+ - name: Extract PyPi package version
61
+ shell: bash
62
+ run: |
63
+ VERSION=${{ github.ref_name }}
64
+ VERSION=${VERSION#v}
65
+ echo "VERSION=$VERSION" >> $GITHUB_ENV
66
+
67
+ - name: Build executable for Windows
68
+ env:
69
+ PYAPP_PROJECT_VERSION: ${{ env.VERSION }}
70
+ PYAPP_PYTHON_VERSION: '3.9'
71
+ run: cargo build --release --manifest-path pyapp/pyapp-latest/Cargo.toml
72
+
73
+ - name: Archive Windows executable
74
+ shell: bash
75
+ working-directory: pyapp/pyapp-latest/target/release
76
+ run: |
77
+ EXECUTABLE_NAME=${{ env.PYAPP_PROJECT_NAME }}_${{ runner.os }}_${{ env.VERSION }}.exe
78
+ mv pyapp.exe $EXECUTABLE_NAME
79
+ tar -czvf ../../../../executable-windows.tar.gz $EXECUTABLE_NAME
80
+
81
+ - name: Upload artifact
82
+ uses: actions/upload-artifact@v2
83
+ with:
84
+ name: executable-${{ runner.os }}
85
+ path: executable-*.tar.gz
86
+
87
+ release:
88
+ needs: build
89
+ runs-on: ubuntu-latest
90
+ steps:
91
+ - name: Checkout code
92
+ uses: actions/checkout@v2
93
+
94
+ - name: Download Windows artifact
95
+ uses: actions/download-artifact@v2
96
+ with:
97
+ name: executable-Windows
98
+ path: .
99
+
100
+ - name: Create Release
101
+ id: create_release
102
+ uses: actions/create-release@v1
103
+ env:
104
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105
+ with:
106
+ tag_name: ${{ github.ref_name }}
107
+ release_name: Release ${{ github.ref_name }}
108
+ draft: false
109
+ prerelease: false
110
+
111
+ - name: Upload Windows executable to release
112
+ uses: actions/upload-release-asset@v1
113
+ env:
114
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115
+ with:
116
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
117
+ asset_path: ./executable-windows.tar.gz
118
+ asset_name: executable-windows.tar.gz
119
+ asset_content_type: application/gzip
@@ -0,0 +1,169 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
159
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
+ #.idea/
161
+
162
+ data/
163
+ old/
164
+ runs/
165
+ pretrained_models/*.pt
166
+ trained_models/*.pt
167
+ notebooks/
168
+
169
+ _version.py
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024, EPFL.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ * Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ * Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ * Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,5 @@
1
+ include LICENSE.txt
2
+ include README.md
3
+
4
+ recursive-exclude * __pycache__
5
+ recursive-exclude * *.py[co]
@@ -0,0 +1,173 @@
1
+ Metadata-Version: 2.1
2
+ Name: tau-fibrils-yolo
3
+ Version: 0.0.1
4
+ Summary: YoloV8 model for the detection of Tau fibrils in Cryo-EM images.
5
+ Author-email: Mallory Wittwer <mallory.wittwer@epfl.ch>
6
+ License: BSD 3-Clause License
7
+
8
+ Copyright (c) 2024, EPFL.
9
+
10
+ Redistribution and use in source and binary forms, with or without
11
+ modification, are permitted provided that the following conditions are met:
12
+
13
+ * Redistributions of source code must retain the above copyright notice, this
14
+ list of conditions and the following disclaimer.
15
+
16
+ * Redistributions in binary form must reproduce the above copyright notice,
17
+ this list of conditions and the following disclaimer in the documentation
18
+ and/or other materials provided with the distribution.
19
+
20
+ * Neither the name of the copyright holder nor the names of its
21
+ contributors may be used to endorse or promote products derived from
22
+ this software without specific prior written permission.
23
+
24
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+ Project-URL: homepage, https://github.com/EPFL-Center-for-Imaging/tau_fibrils_yolo
35
+ Project-URL: repository, https://github.com/EPFL-Center-for-Imaging/tau_fibrils_yolo
36
+ Classifier: Development Status :: 2 - Pre-Alpha
37
+ Classifier: License :: OSI Approved :: BSD License
38
+ Classifier: Programming Language :: Python :: 3
39
+ Classifier: Programming Language :: Python :: 3.9
40
+ Classifier: Programming Language :: Python :: 3.10
41
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
42
+ Requires-Python: >=3.9
43
+ Description-Content-Type: text/markdown
44
+ License-File: LICENSE
45
+ Requires-Dist: napari[all]>=0.4.16
46
+ Requires-Dist: qtpy
47
+ Requires-Dist: magicgui
48
+ Requires-Dist: numpy
49
+ Requires-Dist: pandas
50
+ Requires-Dist: tifffile
51
+ Requires-Dist: pooch==1.8.0
52
+ Requires-Dist: scikit-image
53
+ Requires-Dist: scikit-learn
54
+ Requires-Dist: ultralytics
55
+ Requires-Dist: opencv-contrib-python-headless
56
+
57
+ ![EPFL Center for Imaging logo](https://imaging.epfl.ch/resources/logo-for-gitlab.svg)
58
+ # 🧬 Tau Fibrils Yolo - Object detection in Cryo-EM images
59
+
60
+ ![screenshot](assets/screenshot.png)
61
+
62
+ We provide a [YoloV8](https://docs.ultralytics.com/) model for the detection of oriented bounding boxes (OBBs) of Tau fibrils in Cryo-EM images.
63
+
64
+ [[`Installation`](#installation)] [[`Model`](#model)] [[`Usage`](#usage)]
65
+
66
+ This project is part of a collaboration between the [EPFL Center for Imaging](https://imaging.epfl.ch/) and the [Laboratory of Biological Electron Microscopy](https://www.lbem.ch/).
67
+
68
+ ## Installation
69
+
70
+ ### As a standalone app
71
+
72
+ Soon.
73
+
74
+ ### As a Python package
75
+
76
+ We recommend performing the installation in a clean Python environment. Install our package from PyPi:
77
+
78
+ ```sh
79
+ pip install tau-fibrils-yolo
80
+ ```
81
+
82
+ or from the repository:
83
+
84
+ ```sh
85
+ pip install git+https://gitlab.com/center-for-imaging/tau-fibrils-object-detection.git
86
+ ```
87
+
88
+ or clone the repository and install with:
89
+
90
+ ```sh
91
+ git clone git+https://gitlab.com/center-for-imaging/tau-fibrils-object-detection.git
92
+ cd tau-fibrils-yolo
93
+ pip install -e .
94
+ ```
95
+
96
+ ## Model
97
+
98
+ The model weights (6.5 Mb) are automatically downloaded from [this repository on Zenodo](https://sandbox.zenodo.org/records/99113) the first time you run inference. The model files are saved in the user home folder in the `.yolo` directory.
99
+
100
+ ## Usage
101
+
102
+ **In Napari**
103
+
104
+ To use our model in Napari, start the viewer with
105
+
106
+ ```sh
107
+ napari -w tau-fibrils-yolo
108
+ ```
109
+
110
+ or open the Napari menu bar and select `Plugins > Tau fibrils detection`.
111
+
112
+ Open an image using `File > Open files` or drag-and-drop an image into the viewer window.
113
+
114
+ **Sample data**: To test the model, you can run it on our provided sample image. In Napari, open the image from `File > Open Sample > [TODO - add a sample image]`.
115
+
116
+
117
+ **As a library**
118
+
119
+ You can run the model to detect fibrils in an image (represented as a numpy array).
120
+
121
+ ```py
122
+ from tau_fibrils_yolo import FibrilsDetector
123
+
124
+ detector = FibrilsDetector()
125
+
126
+ boxes, probabilities = detector.predict(your_image)
127
+ ```
128
+
129
+ **As a CLI**
130
+
131
+ Run inference on an image from the command-line. For example:
132
+
133
+ ```sh
134
+ tau_fibrils_predict_image -i /path/to/folder/image_001.tif
135
+ ```
136
+
137
+ The command will save the segmentation next to the image:
138
+
139
+ ```
140
+ folder/
141
+ ├── image_001.tif
142
+ ├── image_001_results.csv
143
+ ```
144
+
145
+ Optionally, you can use the `-r` flag to also rescale the image by a given factor.
146
+
147
+ To run inference in batch on all images in a folder, use:
148
+
149
+ ```sh
150
+ tau_fibrils_predict_folder -i /path/to/folder/
151
+ ```
152
+
153
+ This will produce:
154
+
155
+ ```
156
+ folder/
157
+ ├── image_001.tif
158
+ ├── image_001_results.csv
159
+ ├── image_002.tif
160
+ ├── image_002_results.csv
161
+ ```
162
+
163
+ ## Issues
164
+
165
+ If you encounter any problems, please file an issue along with a detailed description.
166
+
167
+ ## License
168
+
169
+ This model is licensed under the [BSD-3](LICENSE) license.
170
+
171
+ ## Acknowledgements
172
+
173
+ We would particularly like to thank **Valentin Vuillon** for annotating the images on which this model was trained, and for developing the preliminary code that laid the foundation for this image analysis project. The repository containing his original version of the project can be found [here](https://gitlab.com/epfl-center-for-imaging/automated-analysis-tau-fibrils-project).
@@ -0,0 +1,117 @@
1
+ ![EPFL Center for Imaging logo](https://imaging.epfl.ch/resources/logo-for-gitlab.svg)
2
+ # 🧬 Tau Fibrils Yolo - Object detection in Cryo-EM images
3
+
4
+ ![screenshot](assets/screenshot.png)
5
+
6
+ We provide a [YoloV8](https://docs.ultralytics.com/) model for the detection of oriented bounding boxes (OBBs) of Tau fibrils in Cryo-EM images.
7
+
8
+ [[`Installation`](#installation)] [[`Model`](#model)] [[`Usage`](#usage)]
9
+
10
+ This project is part of a collaboration between the [EPFL Center for Imaging](https://imaging.epfl.ch/) and the [Laboratory of Biological Electron Microscopy](https://www.lbem.ch/).
11
+
12
+ ## Installation
13
+
14
+ ### As a standalone app
15
+
16
+ Soon.
17
+
18
+ ### As a Python package
19
+
20
+ We recommend performing the installation in a clean Python environment. Install our package from PyPi:
21
+
22
+ ```sh
23
+ pip install tau-fibrils-yolo
24
+ ```
25
+
26
+ or from the repository:
27
+
28
+ ```sh
29
+ pip install git+https://gitlab.com/center-for-imaging/tau-fibrils-object-detection.git
30
+ ```
31
+
32
+ or clone the repository and install with:
33
+
34
+ ```sh
35
+ git clone git+https://gitlab.com/center-for-imaging/tau-fibrils-object-detection.git
36
+ cd tau-fibrils-yolo
37
+ pip install -e .
38
+ ```
39
+
40
+ ## Model
41
+
42
+ The model weights (6.5 Mb) are automatically downloaded from [this repository on Zenodo](https://sandbox.zenodo.org/records/99113) the first time you run inference. The model files are saved in the user home folder in the `.yolo` directory.
43
+
44
+ ## Usage
45
+
46
+ **In Napari**
47
+
48
+ To use our model in Napari, start the viewer with
49
+
50
+ ```sh
51
+ napari -w tau-fibrils-yolo
52
+ ```
53
+
54
+ or open the Napari menu bar and select `Plugins > Tau fibrils detection`.
55
+
56
+ Open an image using `File > Open files` or drag-and-drop an image into the viewer window.
57
+
58
+ **Sample data**: To test the model, you can run it on our provided sample image. In Napari, open the image from `File > Open Sample > [TODO - add a sample image]`.
59
+
60
+
61
+ **As a library**
62
+
63
+ You can run the model to detect fibrils in an image (represented as a numpy array).
64
+
65
+ ```py
66
+ from tau_fibrils_yolo import FibrilsDetector
67
+
68
+ detector = FibrilsDetector()
69
+
70
+ boxes, probabilities = detector.predict(your_image)
71
+ ```
72
+
73
+ **As a CLI**
74
+
75
+ Run inference on an image from the command-line. For example:
76
+
77
+ ```sh
78
+ tau_fibrils_predict_image -i /path/to/folder/image_001.tif
79
+ ```
80
+
81
+ The command will save the segmentation next to the image:
82
+
83
+ ```
84
+ folder/
85
+ ├── image_001.tif
86
+ ├── image_001_results.csv
87
+ ```
88
+
89
+ Optionally, you can use the `-r` flag to also rescale the image by a given factor.
90
+
91
+ To run inference in batch on all images in a folder, use:
92
+
93
+ ```sh
94
+ tau_fibrils_predict_folder -i /path/to/folder/
95
+ ```
96
+
97
+ This will produce:
98
+
99
+ ```
100
+ folder/
101
+ ├── image_001.tif
102
+ ├── image_001_results.csv
103
+ ├── image_002.tif
104
+ ├── image_002_results.csv
105
+ ```
106
+
107
+ ## Issues
108
+
109
+ If you encounter any problems, please file an issue along with a detailed description.
110
+
111
+ ## License
112
+
113
+ This model is licensed under the [BSD-3](LICENSE) license.
114
+
115
+ ## Acknowledgements
116
+
117
+ We would particularly like to thank **Valentin Vuillon** for annotating the images on which this model was trained, and for developing the preliminary code that laid the foundation for this image analysis project. The repository containing his original version of the project can be found [here](https://gitlab.com/epfl-center-for-imaging/automated-analysis-tau-fibrils-project).
Binary file
@@ -0,0 +1,60 @@
1
+ [project]
2
+ name = "tau-fibrils-yolo"
3
+ dynamic = ["version"]
4
+ description = "YoloV8 model for the detection of Tau fibrils in Cryo-EM images."
5
+ readme = "README.md"
6
+ requires-python = ">=3.9"
7
+ license = {file = "LICENSE"}
8
+ authors = [{ name = "Mallory Wittwer", email = "mallory.wittwer@epfl.ch" }]
9
+
10
+ classifiers = [
11
+ "Development Status :: 2 - Pre-Alpha",
12
+ "License :: OSI Approved :: BSD License",
13
+ "Programming Language :: Python :: 3",
14
+ "Programming Language :: Python :: 3.9",
15
+ "Programming Language :: Python :: 3.10",
16
+ "Topic :: Scientific/Engineering :: Image Processing",
17
+ ]
18
+
19
+ dependencies = [
20
+ "napari[all]>=0.4.16",
21
+ "qtpy",
22
+ "magicgui",
23
+ "numpy",
24
+ "pandas",
25
+ "tifffile",
26
+ "pooch==1.8.0",
27
+ "scikit-image",
28
+ "scikit-learn",
29
+ "ultralytics",
30
+ "opencv-contrib-python-headless"
31
+ ]
32
+
33
+ [project.entry-points."napari.manifest"]
34
+ tau_fibrils_yolo = "tau_fibrils_yolo:napari.yaml"
35
+
36
+ [project.scripts]
37
+ tau_fibrils_predict_image = "tau_fibrils_yolo.cli:cli_predict_image"
38
+ tau_fibrils_predict_folder = "tau_fibrils_yolo.cli:cli_predict_folder"
39
+
40
+ [project.urls]
41
+ homepage = "https://github.com/EPFL-Center-for-Imaging/tau_fibrils_yolo"
42
+ repository = "https://github.com/EPFL-Center-for-Imaging/tau_fibrils_yolo"
43
+
44
+ [build-system]
45
+ requires = ["setuptools>=42.0.0", "wheel", "setuptools_scm"]
46
+ build-backend = "setuptools.build_meta"
47
+
48
+ [tool.setuptools]
49
+ include-package-data = true
50
+
51
+ [tool.setuptools.packages.find]
52
+ where = ["src"]
53
+
54
+ [tool.setuptools.package-data]
55
+ "*" = ["*.yaml"]
56
+
57
+ [tool.setuptools_scm]
58
+ write_to = "src/tau_fibrils_yolo/_version.py"
59
+ version_scheme = "guess-next-dev"
60
+ local_scheme = "no-local-version"
@@ -0,0 +1,29 @@
1
+ import sys
2
+ from ultralytics import YOLO
3
+
4
+ PRETRAINED_MODEL_FILE = '/home/wittwer/code/tau-fibrils-yolo/pretrained_models/yolov8n-obb.pt'
5
+
6
+ if __name__=='__main__':
7
+ _, metadata_file = sys.argv
8
+ model = YOLO(
9
+ model=PRETRAINED_MODEL_FILE,
10
+ task='obb'
11
+ )
12
+
13
+ model.train(
14
+ data=metadata_file,
15
+ epochs=100,
16
+ imgsz=640,
17
+ device=0, # Single GPU.
18
+ project='/home/wittwer/code/tau-fibrils-yolo',
19
+ name='yolo_output',
20
+ exist_ok=True, # Overwrite the previous output
21
+ pretrained=True,
22
+ val=True,
23
+ plots=False,
24
+ # Augmentations
25
+ flipud=0.5, # Flip the image with the specified probability
26
+ fliplr=0.5,
27
+ scale=0.5, # Meaningful?
28
+ degrees=180, # Rotation
29
+ )