imagebaker 0.0.3__tar.gz → 0.0.4__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.
- {imagebaker-0.0.3/imagebaker.egg-info → imagebaker-0.0.4}/PKG-INFO +44 -10
- imagebaker-0.0.3/PKG-INFO → imagebaker-0.0.4/README.md +23 -19
- {imagebaker-0.0.3 → imagebaker-0.0.4}/imagebaker/__init__.py +2 -0
- imagebaker-0.0.3/README.md → imagebaker-0.0.4/imagebaker.egg-info/PKG-INFO +53 -5
- imagebaker-0.0.4/imagebaker.egg-info/SOURCES.txt +10 -0
- imagebaker-0.0.4/imagebaker.egg-info/requires.txt +16 -0
- imagebaker-0.0.4/pyproject.toml +62 -0
- imagebaker-0.0.3/imagebaker/core/__init__.py +0 -0
- imagebaker-0.0.3/imagebaker/core/configs/__init__.py +0 -1
- imagebaker-0.0.3/imagebaker/core/configs/configs.py +0 -149
- imagebaker-0.0.3/imagebaker/core/defs/__init__.py +0 -1
- imagebaker-0.0.3/imagebaker/core/defs/defs.py +0 -239
- imagebaker-0.0.3/imagebaker/core/plugins/__init__.py +0 -0
- imagebaker-0.0.3/imagebaker/core/plugins/base_plugin.py +0 -39
- imagebaker-0.0.3/imagebaker/core/plugins/cosine_plugin.py +0 -39
- imagebaker-0.0.3/imagebaker/layers/__init__.py +0 -3
- imagebaker-0.0.3/imagebaker/layers/annotable_layer.py +0 -847
- imagebaker-0.0.3/imagebaker/layers/base_layer.py +0 -477
- imagebaker-0.0.3/imagebaker/layers/canvas_layer.py +0 -825
- imagebaker-0.0.3/imagebaker/list_views/__init__.py +0 -3
- imagebaker-0.0.3/imagebaker/list_views/annotation_list.py +0 -203
- imagebaker-0.0.3/imagebaker/list_views/canvas_list.py +0 -179
- imagebaker-0.0.3/imagebaker/list_views/image_list.py +0 -138
- imagebaker-0.0.3/imagebaker/list_views/layer_list.py +0 -379
- imagebaker-0.0.3/imagebaker/list_views/layer_settings.py +0 -212
- imagebaker-0.0.3/imagebaker/models/__init__.py +0 -0
- imagebaker-0.0.3/imagebaker/models/base_model.py +0 -144
- imagebaker-0.0.3/imagebaker/models/rtdetr_v2.py +0 -255
- imagebaker-0.0.3/imagebaker/models/sam_model.py +0 -362
- imagebaker-0.0.3/imagebaker/models/segmentation.py +0 -289
- imagebaker-0.0.3/imagebaker/tabs/__init__.py +0 -2
- imagebaker-0.0.3/imagebaker/tabs/baker_tab.py +0 -387
- imagebaker-0.0.3/imagebaker/tabs/layerify_tab.py +0 -776
- imagebaker-0.0.3/imagebaker/utils/__init__.py +0 -0
- imagebaker-0.0.3/imagebaker/utils/image.py +0 -95
- imagebaker-0.0.3/imagebaker/utils/state_utils.py +0 -64
- imagebaker-0.0.3/imagebaker/utils/transform_mask.py +0 -112
- imagebaker-0.0.3/imagebaker/window/__init__.py +0 -1
- imagebaker-0.0.3/imagebaker/window/app.py +0 -136
- imagebaker-0.0.3/imagebaker/window/main_window.py +0 -171
- imagebaker-0.0.3/imagebaker/workers/__init__.py +0 -3
- imagebaker-0.0.3/imagebaker/workers/baker_worker.py +0 -182
- imagebaker-0.0.3/imagebaker/workers/layerfy_worker.py +0 -81
- imagebaker-0.0.3/imagebaker/workers/model_worker.py +0 -43
- imagebaker-0.0.3/imagebaker.egg-info/SOURCES.txt +0 -47
- imagebaker-0.0.3/imagebaker.egg-info/requires.txt +0 -8
- imagebaker-0.0.3/setup.py +0 -34
- {imagebaker-0.0.3 → imagebaker-0.0.4}/LICENSE +0 -0
- {imagebaker-0.0.3 → imagebaker-0.0.4}/imagebaker.egg-info/dependency_links.txt +0 -0
- {imagebaker-0.0.3 → imagebaker-0.0.4}/imagebaker.egg-info/entry_points.txt +0 -0
- {imagebaker-0.0.3 → imagebaker-0.0.4}/imagebaker.egg-info/top_level.txt +0 -0
- {imagebaker-0.0.3 → imagebaker-0.0.4}/setup.cfg +0 -0
@@ -1,16 +1,32 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: imagebaker
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.4
|
4
4
|
Summary: A package for baking images.
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
Author-email: Ramkrishna Acharya <qramkrishna@gmail.com>
|
6
|
+
License: MIT
|
7
|
+
Project-URL: Homepage, https://github.com/q-viper/Image-Baker
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
10
10
|
Classifier: Operating System :: OS Independent
|
11
11
|
Requires-Python: >=3.10
|
12
12
|
Description-Content-Type: text/markdown
|
13
13
|
License-File: LICENSE
|
14
|
+
Requires-Dist: numpy>=1.21
|
15
|
+
Requires-Dist: matplotlib>=3.4
|
16
|
+
Requires-Dist: opencv-python>=4.5
|
17
|
+
Requires-Dist: black>=23.1
|
18
|
+
Requires-Dist: pydantic>=2.0
|
19
|
+
Requires-Dist: flake8>=6.0
|
20
|
+
Requires-Dist: typer>=0.9
|
21
|
+
Requires-Dist: PySide6==6.8.3
|
22
|
+
Requires-Dist: loguru
|
23
|
+
Provides-Extra: docs
|
24
|
+
Requires-Dist: mkdocs>=1.4; extra == "docs"
|
25
|
+
Requires-Dist: mkdocs-material>=9.0; extra == "docs"
|
26
|
+
Requires-Dist: mkdocstrings[python]>=0.21; extra == "docs"
|
27
|
+
Requires-Dist: pymdown-extensions>=8.0; extra == "docs"
|
28
|
+
Requires-Dist: mkdocs-awesome-pages-plugin; extra == "docs"
|
29
|
+
Dynamic: license-file
|
14
30
|
|
15
31
|
# Image-Baker
|
16
32
|
|
@@ -29,16 +45,18 @@ The concept involves extracting portions of an image (e.g., objects of interest)
|
|
29
45
|
### Installation
|
30
46
|
|
31
47
|
#### Using PIP
|
48
|
+
This project is also available in PyPI server.
|
32
49
|
|
33
50
|
```bash
|
34
51
|
pip install imagebaker
|
35
52
|
```
|
36
53
|
|
37
54
|
#### Developing
|
38
|
-
|
39
|
-
Clone this repository and install it locally:
|
55
|
+
Please, clone this repository and install it locally:
|
40
56
|
|
41
57
|
```bash
|
58
|
+
git clone https://github.com/q-viper/image-baker.git
|
59
|
+
cd image-baker
|
42
60
|
pip install -e .
|
43
61
|
```
|
44
62
|
|
@@ -50,7 +68,7 @@ Run the following command to launch the GUI:
|
|
50
68
|
imagebaker
|
51
69
|
```
|
52
70
|
|
53
|
-
If the command does not work, try running the example script
|
71
|
+
If the command does not work, try running the example script after cloning the project.:
|
54
72
|
|
55
73
|
```bash
|
56
74
|
python examples/app.py
|
@@ -75,9 +93,25 @@ python examples/app.py
|
|
75
93
|
* **Right Click**: Deselect an annotation/layer. While on annotating polygon, undo last point.
|
76
94
|
* **Ctrl + Mouse Wheel**: Zoom In/Out on the mouse position i.e. resizes the viewport.
|
77
95
|
* **Ctrl + Drag**: If done on the background, the viewport is panned.
|
78
|
-
* **Ctrl + S**: Save State.
|
96
|
+
* **Ctrl + S**: Save State on Baker Tab.
|
97
|
+
* **Ctrl + D**: Draw Mode on Baker Tab. Drawing can happen on a selected or main layer.
|
98
|
+
* **Ctrl + E**: Erase Mode on Baker Tab.
|
99
|
+
* **Wheel**: Change size of the drawing pointer.
|
100
|
+
|
101
|
+
|
102
|
+
## Demo
|
103
|
+
|
104
|
+
## Demo
|
105
|
+
|
106
|
+
To see the tool in action, check out the demo video below:
|
107
|
+
|
108
|
+
[](https://youtu.be/WckMT0r-2Lc)
|
109
|
+
|
110
|
+
Click on the image above to play the video on YouTube.
|
79
111
|
|
80
112
|
|
81
113
|
## Contributions
|
82
114
|
|
83
|
-
Contributions are welcome!
|
115
|
+
Contributions are welcome!
|
116
|
+
|
117
|
+
Do you find this project to be useful and looking for some features that is not implemented yet? Feel free to open issues or submit pull requests to improve the project.
|
@@ -1,17 +1,3 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: imagebaker
|
3
|
-
Version: 0.0.3
|
4
|
-
Summary: A package for baking images.
|
5
|
-
Home-page: https://github.com/q-viper/Image-Baker
|
6
|
-
Author: Ramkrishna Acharya
|
7
|
-
Author-email: qramkrishna@gmail.com
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
10
|
-
Classifier: Operating System :: OS Independent
|
11
|
-
Requires-Python: >=3.10
|
12
|
-
Description-Content-Type: text/markdown
|
13
|
-
License-File: LICENSE
|
14
|
-
|
15
1
|
# Image-Baker
|
16
2
|
|
17
3
|
Let's bake an image.
|
@@ -29,16 +15,18 @@ The concept involves extracting portions of an image (e.g., objects of interest)
|
|
29
15
|
### Installation
|
30
16
|
|
31
17
|
#### Using PIP
|
18
|
+
This project is also available in PyPI server.
|
32
19
|
|
33
20
|
```bash
|
34
21
|
pip install imagebaker
|
35
22
|
```
|
36
23
|
|
37
24
|
#### Developing
|
38
|
-
|
39
|
-
Clone this repository and install it locally:
|
25
|
+
Please, clone this repository and install it locally:
|
40
26
|
|
41
27
|
```bash
|
28
|
+
git clone https://github.com/q-viper/image-baker.git
|
29
|
+
cd image-baker
|
42
30
|
pip install -e .
|
43
31
|
```
|
44
32
|
|
@@ -50,7 +38,7 @@ Run the following command to launch the GUI:
|
|
50
38
|
imagebaker
|
51
39
|
```
|
52
40
|
|
53
|
-
If the command does not work, try running the example script
|
41
|
+
If the command does not work, try running the example script after cloning the project.:
|
54
42
|
|
55
43
|
```bash
|
56
44
|
python examples/app.py
|
@@ -75,9 +63,25 @@ python examples/app.py
|
|
75
63
|
* **Right Click**: Deselect an annotation/layer. While on annotating polygon, undo last point.
|
76
64
|
* **Ctrl + Mouse Wheel**: Zoom In/Out on the mouse position i.e. resizes the viewport.
|
77
65
|
* **Ctrl + Drag**: If done on the background, the viewport is panned.
|
78
|
-
* **Ctrl + S**: Save State.
|
66
|
+
* **Ctrl + S**: Save State on Baker Tab.
|
67
|
+
* **Ctrl + D**: Draw Mode on Baker Tab. Drawing can happen on a selected or main layer.
|
68
|
+
* **Ctrl + E**: Erase Mode on Baker Tab.
|
69
|
+
* **Wheel**: Change size of the drawing pointer.
|
70
|
+
|
71
|
+
|
72
|
+
## Demo
|
73
|
+
|
74
|
+
## Demo
|
75
|
+
|
76
|
+
To see the tool in action, check out the demo video below:
|
77
|
+
|
78
|
+
[](https://youtu.be/WckMT0r-2Lc)
|
79
|
+
|
80
|
+
Click on the image above to play the video on YouTube.
|
79
81
|
|
80
82
|
|
81
83
|
## Contributions
|
82
84
|
|
83
|
-
Contributions are welcome!
|
85
|
+
Contributions are welcome!
|
86
|
+
|
87
|
+
Do you find this project to be useful and looking for some features that is not implemented yet? Feel free to open issues or submit pull requests to improve the project.
|
@@ -1,3 +1,33 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: imagebaker
|
3
|
+
Version: 0.0.4
|
4
|
+
Summary: A package for baking images.
|
5
|
+
Author-email: Ramkrishna Acharya <qramkrishna@gmail.com>
|
6
|
+
License: MIT
|
7
|
+
Project-URL: Homepage, https://github.com/q-viper/Image-Baker
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
10
|
+
Classifier: Operating System :: OS Independent
|
11
|
+
Requires-Python: >=3.10
|
12
|
+
Description-Content-Type: text/markdown
|
13
|
+
License-File: LICENSE
|
14
|
+
Requires-Dist: numpy>=1.21
|
15
|
+
Requires-Dist: matplotlib>=3.4
|
16
|
+
Requires-Dist: opencv-python>=4.5
|
17
|
+
Requires-Dist: black>=23.1
|
18
|
+
Requires-Dist: pydantic>=2.0
|
19
|
+
Requires-Dist: flake8>=6.0
|
20
|
+
Requires-Dist: typer>=0.9
|
21
|
+
Requires-Dist: PySide6==6.8.3
|
22
|
+
Requires-Dist: loguru
|
23
|
+
Provides-Extra: docs
|
24
|
+
Requires-Dist: mkdocs>=1.4; extra == "docs"
|
25
|
+
Requires-Dist: mkdocs-material>=9.0; extra == "docs"
|
26
|
+
Requires-Dist: mkdocstrings[python]>=0.21; extra == "docs"
|
27
|
+
Requires-Dist: pymdown-extensions>=8.0; extra == "docs"
|
28
|
+
Requires-Dist: mkdocs-awesome-pages-plugin; extra == "docs"
|
29
|
+
Dynamic: license-file
|
30
|
+
|
1
31
|
# Image-Baker
|
2
32
|
|
3
33
|
Let's bake an image.
|
@@ -15,16 +45,18 @@ The concept involves extracting portions of an image (e.g., objects of interest)
|
|
15
45
|
### Installation
|
16
46
|
|
17
47
|
#### Using PIP
|
48
|
+
This project is also available in PyPI server.
|
18
49
|
|
19
50
|
```bash
|
20
51
|
pip install imagebaker
|
21
52
|
```
|
22
53
|
|
23
54
|
#### Developing
|
24
|
-
|
25
|
-
Clone this repository and install it locally:
|
55
|
+
Please, clone this repository and install it locally:
|
26
56
|
|
27
57
|
```bash
|
58
|
+
git clone https://github.com/q-viper/image-baker.git
|
59
|
+
cd image-baker
|
28
60
|
pip install -e .
|
29
61
|
```
|
30
62
|
|
@@ -36,7 +68,7 @@ Run the following command to launch the GUI:
|
|
36
68
|
imagebaker
|
37
69
|
```
|
38
70
|
|
39
|
-
If the command does not work, try running the example script
|
71
|
+
If the command does not work, try running the example script after cloning the project.:
|
40
72
|
|
41
73
|
```bash
|
42
74
|
python examples/app.py
|
@@ -61,9 +93,25 @@ python examples/app.py
|
|
61
93
|
* **Right Click**: Deselect an annotation/layer. While on annotating polygon, undo last point.
|
62
94
|
* **Ctrl + Mouse Wheel**: Zoom In/Out on the mouse position i.e. resizes the viewport.
|
63
95
|
* **Ctrl + Drag**: If done on the background, the viewport is panned.
|
64
|
-
* **Ctrl + S**: Save State.
|
96
|
+
* **Ctrl + S**: Save State on Baker Tab.
|
97
|
+
* **Ctrl + D**: Draw Mode on Baker Tab. Drawing can happen on a selected or main layer.
|
98
|
+
* **Ctrl + E**: Erase Mode on Baker Tab.
|
99
|
+
* **Wheel**: Change size of the drawing pointer.
|
100
|
+
|
101
|
+
|
102
|
+
## Demo
|
103
|
+
|
104
|
+
## Demo
|
105
|
+
|
106
|
+
To see the tool in action, check out the demo video below:
|
107
|
+
|
108
|
+
[](https://youtu.be/WckMT0r-2Lc)
|
109
|
+
|
110
|
+
Click on the image above to play the video on YouTube.
|
65
111
|
|
66
112
|
|
67
113
|
## Contributions
|
68
114
|
|
69
|
-
Contributions are welcome!
|
115
|
+
Contributions are welcome!
|
116
|
+
|
117
|
+
Do you find this project to be useful and looking for some features that is not implemented yet? Feel free to open issues or submit pull requests to improve the project.
|
@@ -0,0 +1,10 @@
|
|
1
|
+
LICENSE
|
2
|
+
README.md
|
3
|
+
pyproject.toml
|
4
|
+
imagebaker/__init__.py
|
5
|
+
imagebaker.egg-info/PKG-INFO
|
6
|
+
imagebaker.egg-info/SOURCES.txt
|
7
|
+
imagebaker.egg-info/dependency_links.txt
|
8
|
+
imagebaker.egg-info/entry_points.txt
|
9
|
+
imagebaker.egg-info/requires.txt
|
10
|
+
imagebaker.egg-info/top_level.txt
|
@@ -0,0 +1,16 @@
|
|
1
|
+
numpy>=1.21
|
2
|
+
matplotlib>=3.4
|
3
|
+
opencv-python>=4.5
|
4
|
+
black>=23.1
|
5
|
+
pydantic>=2.0
|
6
|
+
flake8>=6.0
|
7
|
+
typer>=0.9
|
8
|
+
PySide6==6.8.3
|
9
|
+
loguru
|
10
|
+
|
11
|
+
[docs]
|
12
|
+
mkdocs>=1.4
|
13
|
+
mkdocs-material>=9.0
|
14
|
+
mkdocstrings[python]>=0.21
|
15
|
+
pymdown-extensions>=8.0
|
16
|
+
mkdocs-awesome-pages-plugin
|
@@ -0,0 +1,62 @@
|
|
1
|
+
[build-system]
|
2
|
+
requires = ["setuptools>=42", "wheel"]
|
3
|
+
build-backend = "setuptools.build_meta"
|
4
|
+
|
5
|
+
[project]
|
6
|
+
name = "imagebaker"
|
7
|
+
version = "0.0.4"
|
8
|
+
description = "A package for baking images."
|
9
|
+
readme = "README.md"
|
10
|
+
license = { text = "MIT" }
|
11
|
+
authors = [
|
12
|
+
{ name = "Ramkrishna Acharya", email = "qramkrishna@gmail.com" }
|
13
|
+
]
|
14
|
+
requires-python = ">=3.10"
|
15
|
+
classifiers = [
|
16
|
+
"Programming Language :: Python :: 3",
|
17
|
+
"License :: OSI Approved :: MIT License",
|
18
|
+
"Operating System :: OS Independent"
|
19
|
+
]
|
20
|
+
|
21
|
+
dependencies = [
|
22
|
+
"numpy>=1.21",
|
23
|
+
"matplotlib>=3.4",
|
24
|
+
"opencv-python>=4.5",
|
25
|
+
"black>=23.1",
|
26
|
+
"pydantic>=2.0",
|
27
|
+
"flake8>=6.0",
|
28
|
+
"typer>=0.9",
|
29
|
+
"PySide6==6.8.3",
|
30
|
+
"loguru"
|
31
|
+
]
|
32
|
+
|
33
|
+
[project.scripts]
|
34
|
+
imagebaker = "imagebaker.window.app:app_cli"
|
35
|
+
|
36
|
+
[project.urls]
|
37
|
+
Homepage = "https://github.com/q-viper/Image-Baker"
|
38
|
+
|
39
|
+
[tool.setuptools]
|
40
|
+
packages = ["imagebaker"]
|
41
|
+
|
42
|
+
[tool.black]
|
43
|
+
line-length = 88
|
44
|
+
target-version = ["py310"]
|
45
|
+
|
46
|
+
[tool.flake8]
|
47
|
+
max-line-length = 88
|
48
|
+
exclude = ["build", "dist", ".venv", "__pycache__"]
|
49
|
+
|
50
|
+
[tool.pytest.ini_options]
|
51
|
+
minversion = "6.0"
|
52
|
+
addopts = "--strict-markers"
|
53
|
+
testpaths = ["tests"]
|
54
|
+
|
55
|
+
[project.optional-dependencies]
|
56
|
+
docs = [
|
57
|
+
"mkdocs>=1.4",
|
58
|
+
"mkdocs-material>=9.0",
|
59
|
+
"mkdocstrings[python]>=0.21",
|
60
|
+
"pymdown-extensions>=8.0",
|
61
|
+
"mkdocs-awesome-pages-plugin"
|
62
|
+
]
|
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
from .configs import * # noqa
|
@@ -1,149 +0,0 @@
|
|
1
|
-
from pathlib import Path
|
2
|
-
from typing import List, Tuple
|
3
|
-
|
4
|
-
from PySide6.QtCore import Qt
|
5
|
-
from PySide6.QtGui import QColor
|
6
|
-
from pydantic import BaseModel, Field
|
7
|
-
|
8
|
-
from imagebaker.core.defs import Label, ModelType
|
9
|
-
|
10
|
-
|
11
|
-
class DrawConfig(BaseModel):
|
12
|
-
color: QColor = Field(default_factory=lambda: QColor(255, 255, 255))
|
13
|
-
point_size: int = 5
|
14
|
-
line_width: int = 5
|
15
|
-
control_point_size: int = 1.5
|
16
|
-
ellipse_size: int = 8
|
17
|
-
pen_alpha: int = 150
|
18
|
-
brush_alpha: int = 50
|
19
|
-
brush_fill_pattern: Qt.BrushStyle = Qt.BrushStyle.DiagCrossPattern
|
20
|
-
thumbnail_size: Tuple[int, int] = Field(default_factory=lambda: (50, 50))
|
21
|
-
background_color: QColor = Field(default_factory=lambda: QColor(0, 0, 0, 255))
|
22
|
-
label_font_size: int = 12
|
23
|
-
label_font_background_color: QColor = Field(
|
24
|
-
default_factory=lambda: QColor(0, 0, 0, 150)
|
25
|
-
)
|
26
|
-
handle_color: QColor = Field(default_factory=lambda: QColor(0, 255, 255, 150))
|
27
|
-
handle_width: int = 2
|
28
|
-
handle_point_size: int = 6
|
29
|
-
handle_edge_size: int = 4
|
30
|
-
|
31
|
-
button_width: int = 30
|
32
|
-
|
33
|
-
class Config:
|
34
|
-
arbitrary_types_allowed = True
|
35
|
-
|
36
|
-
|
37
|
-
class BaseConfig(BaseModel):
|
38
|
-
project_name: str = "ImageBaker"
|
39
|
-
version: str = "0.1.0"
|
40
|
-
project_dir: Path = Path(".")
|
41
|
-
|
42
|
-
is_debug: bool = True
|
43
|
-
deque_maxlen: int = 10
|
44
|
-
|
45
|
-
# drawing configs #
|
46
|
-
# ON SELECTION
|
47
|
-
selected_draw_config: DrawConfig = DrawConfig(
|
48
|
-
color=QColor(255, 0, 0),
|
49
|
-
point_size=5,
|
50
|
-
line_width=5,
|
51
|
-
ellipse_size=8,
|
52
|
-
pen_alpha=150,
|
53
|
-
brush_alpha=50,
|
54
|
-
thumbnail_size=(50, 50),
|
55
|
-
brush_fill_pattern=Qt.BrushStyle.CrossPattern,
|
56
|
-
)
|
57
|
-
normal_draw_config: DrawConfig = DrawConfig()
|
58
|
-
zoom_in_factor: float = 1.1
|
59
|
-
zoom_out_factor: float = 0.9
|
60
|
-
|
61
|
-
@property
|
62
|
-
def assets_folder(self):
|
63
|
-
return self.project_dir / "assets"
|
64
|
-
|
65
|
-
class Config:
|
66
|
-
arbitrary_types_allowed = True
|
67
|
-
|
68
|
-
|
69
|
-
class LayerConfig(BaseConfig):
|
70
|
-
show_labels: bool = True
|
71
|
-
show_annotations: bool = True
|
72
|
-
|
73
|
-
default_label: Label = Field(
|
74
|
-
default_factory=lambda: Label("Unlabeled", QColor(255, 255, 255))
|
75
|
-
)
|
76
|
-
predefined_labels: List[Label] = Field(
|
77
|
-
default_factory=lambda: [
|
78
|
-
Label("Unlabeled", QColor(255, 255, 255)),
|
79
|
-
Label("Label 1", QColor(255, 0, 0)),
|
80
|
-
Label("Label 2", QColor(0, 255, 0)),
|
81
|
-
Label("Label 3", QColor(0, 0, 255)),
|
82
|
-
Label("Custom", QColor(128, 128, 128)),
|
83
|
-
]
|
84
|
-
)
|
85
|
-
|
86
|
-
def get_label_color(self, label):
|
87
|
-
for lbl in self.predefined_labels:
|
88
|
-
if lbl.name == label:
|
89
|
-
return lbl.color
|
90
|
-
return self.default_label.color
|
91
|
-
|
92
|
-
|
93
|
-
class CanvasConfig(BaseConfig):
|
94
|
-
save_on_bake: bool = True
|
95
|
-
bake_timeout: float = -1.0
|
96
|
-
filename_format: str = "{project_name}_{timestamp}"
|
97
|
-
export_format: str = "png"
|
98
|
-
max_xpos: int = 1000
|
99
|
-
max_ypos: int = 1000
|
100
|
-
max_scale: int = 10
|
101
|
-
# whether to allow the use of sliders to change layer properties
|
102
|
-
allow_slider_usage: bool = True
|
103
|
-
|
104
|
-
write_annotations: bool = True
|
105
|
-
write_labels: bool = True
|
106
|
-
write_masks: bool = True
|
107
|
-
fps: int = 5
|
108
|
-
|
109
|
-
@property
|
110
|
-
def export_folder(self):
|
111
|
-
folder = self.project_dir / "assets" / "exports"
|
112
|
-
folder.mkdir(parents=True, exist_ok=True)
|
113
|
-
return folder
|
114
|
-
|
115
|
-
|
116
|
-
class CursorDef:
|
117
|
-
POINT_CURSOR: Qt.CursorShape = Qt.CrossCursor
|
118
|
-
POLYGON_CURSOR: Qt.CursorShape = Qt.CrossCursor
|
119
|
-
RECTANGLE_CURSOR: Qt.CursorShape = Qt.CrossCursor
|
120
|
-
IDLE_CURSOR: Qt.CursorShape = Qt.ArrowCursor
|
121
|
-
PAN_CURSOR: Qt.CursorShape = Qt.OpenHandCursor
|
122
|
-
ZOOM_IN_CURSOR: Qt.CursorShape = Qt.SizeFDiagCursor
|
123
|
-
ZOOM_OUT_CURSOR: Qt.CursorShape = Qt.SizeBDiagCursor
|
124
|
-
TRANSFORM_UPDOWN: Qt.CursorShape = Qt.SizeVerCursor
|
125
|
-
TRANSFORM_LEFTRIGHT: Qt.CursorShape = Qt.SizeHorCursor
|
126
|
-
TRANSFORM_ALL: Qt.CursorShape = Qt.SizeAllCursor
|
127
|
-
GRAB_CURSOR: Qt.CursorShape = Qt.OpenHandCursor
|
128
|
-
GRABBING_CURSOR: Qt.CursorShape = Qt.ClosedHandCursor
|
129
|
-
|
130
|
-
|
131
|
-
class DefaultModelConfig(BaseModel):
|
132
|
-
model_type: ModelType = ModelType.DETECTION
|
133
|
-
model_name: str = "Dummy Model"
|
134
|
-
model_description: str = "This is a dummy model"
|
135
|
-
model_version: str = "1.0"
|
136
|
-
model_author: str = "Anonymous"
|
137
|
-
model_license: str = "MIT"
|
138
|
-
input_size: Tuple[int, int] = (224, 224)
|
139
|
-
input_channels: int = 3
|
140
|
-
class_names: List[str] = ["class1", "class2", "class3"]
|
141
|
-
device: str = "cpu"
|
142
|
-
return_annotated_image: bool = False
|
143
|
-
|
144
|
-
@property
|
145
|
-
def num_classes(self):
|
146
|
-
return len(self.class_names)
|
147
|
-
|
148
|
-
class Config:
|
149
|
-
arbitrary_types_allowed = True
|
@@ -1 +0,0 @@
|
|
1
|
-
from .defs import * # noqa
|