imagebaker 0.0.3__tar.gz → 0.0.41__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.
Files changed (55) hide show
  1. imagebaker-0.0.41/PKG-INFO +153 -0
  2. imagebaker-0.0.41/README.md +123 -0
  3. {imagebaker-0.0.3 → imagebaker-0.0.41}/imagebaker/__init__.py +2 -0
  4. imagebaker-0.0.41/imagebaker.egg-info/PKG-INFO +153 -0
  5. imagebaker-0.0.41/imagebaker.egg-info/SOURCES.txt +10 -0
  6. imagebaker-0.0.41/imagebaker.egg-info/requires.txt +16 -0
  7. imagebaker-0.0.41/pyproject.toml +62 -0
  8. imagebaker-0.0.3/PKG-INFO +0 -83
  9. imagebaker-0.0.3/README.md +0 -69
  10. imagebaker-0.0.3/imagebaker/core/__init__.py +0 -0
  11. imagebaker-0.0.3/imagebaker/core/configs/__init__.py +0 -1
  12. imagebaker-0.0.3/imagebaker/core/configs/configs.py +0 -149
  13. imagebaker-0.0.3/imagebaker/core/defs/__init__.py +0 -1
  14. imagebaker-0.0.3/imagebaker/core/defs/defs.py +0 -239
  15. imagebaker-0.0.3/imagebaker/core/plugins/__init__.py +0 -0
  16. imagebaker-0.0.3/imagebaker/core/plugins/base_plugin.py +0 -39
  17. imagebaker-0.0.3/imagebaker/core/plugins/cosine_plugin.py +0 -39
  18. imagebaker-0.0.3/imagebaker/layers/__init__.py +0 -3
  19. imagebaker-0.0.3/imagebaker/layers/annotable_layer.py +0 -847
  20. imagebaker-0.0.3/imagebaker/layers/base_layer.py +0 -477
  21. imagebaker-0.0.3/imagebaker/layers/canvas_layer.py +0 -825
  22. imagebaker-0.0.3/imagebaker/list_views/__init__.py +0 -3
  23. imagebaker-0.0.3/imagebaker/list_views/annotation_list.py +0 -203
  24. imagebaker-0.0.3/imagebaker/list_views/canvas_list.py +0 -179
  25. imagebaker-0.0.3/imagebaker/list_views/image_list.py +0 -138
  26. imagebaker-0.0.3/imagebaker/list_views/layer_list.py +0 -379
  27. imagebaker-0.0.3/imagebaker/list_views/layer_settings.py +0 -212
  28. imagebaker-0.0.3/imagebaker/models/__init__.py +0 -0
  29. imagebaker-0.0.3/imagebaker/models/base_model.py +0 -144
  30. imagebaker-0.0.3/imagebaker/models/rtdetr_v2.py +0 -255
  31. imagebaker-0.0.3/imagebaker/models/sam_model.py +0 -362
  32. imagebaker-0.0.3/imagebaker/models/segmentation.py +0 -289
  33. imagebaker-0.0.3/imagebaker/tabs/__init__.py +0 -2
  34. imagebaker-0.0.3/imagebaker/tabs/baker_tab.py +0 -387
  35. imagebaker-0.0.3/imagebaker/tabs/layerify_tab.py +0 -776
  36. imagebaker-0.0.3/imagebaker/utils/__init__.py +0 -0
  37. imagebaker-0.0.3/imagebaker/utils/image.py +0 -95
  38. imagebaker-0.0.3/imagebaker/utils/state_utils.py +0 -64
  39. imagebaker-0.0.3/imagebaker/utils/transform_mask.py +0 -112
  40. imagebaker-0.0.3/imagebaker/window/__init__.py +0 -1
  41. imagebaker-0.0.3/imagebaker/window/app.py +0 -136
  42. imagebaker-0.0.3/imagebaker/window/main_window.py +0 -171
  43. imagebaker-0.0.3/imagebaker/workers/__init__.py +0 -3
  44. imagebaker-0.0.3/imagebaker/workers/baker_worker.py +0 -182
  45. imagebaker-0.0.3/imagebaker/workers/layerfy_worker.py +0 -81
  46. imagebaker-0.0.3/imagebaker/workers/model_worker.py +0 -43
  47. imagebaker-0.0.3/imagebaker.egg-info/PKG-INFO +0 -83
  48. imagebaker-0.0.3/imagebaker.egg-info/SOURCES.txt +0 -47
  49. imagebaker-0.0.3/imagebaker.egg-info/requires.txt +0 -8
  50. imagebaker-0.0.3/setup.py +0 -34
  51. {imagebaker-0.0.3 → imagebaker-0.0.41}/LICENSE +0 -0
  52. {imagebaker-0.0.3 → imagebaker-0.0.41}/imagebaker.egg-info/dependency_links.txt +0 -0
  53. {imagebaker-0.0.3 → imagebaker-0.0.41}/imagebaker.egg-info/entry_points.txt +0 -0
  54. {imagebaker-0.0.3 → imagebaker-0.0.41}/imagebaker.egg-info/top_level.txt +0 -0
  55. {imagebaker-0.0.3 → imagebaker-0.0.41}/setup.cfg +0 -0
@@ -0,0 +1,153 @@
1
+ Metadata-Version: 2.4
2
+ Name: imagebaker
3
+ Version: 0.0.41
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
+
31
+ # Image-Baker
32
+ ![Dependabot Status](https://img.shields.io/badge/dependabot-active-brightgreen)
33
+ ![GitHub License](https://img.shields.io/github/license/q-viper/image-baker)
34
+ ![commit activity](https://img.shields.io/github/commit-activity/w/q-viper/SmokeSim/master)
35
+ ![code size in bytes](https://img.shields.io/github/languages/code-size/q-viper/image-baker)
36
+ <!-- ![Tests](https://github.com/q-viper/SmokeSim/actions/workflows/test-on-push.yml/badge.svg) -->
37
+ ![Code Formatting](https://github.com/q-viper/image-baker/actions/workflows/black-formatter.yml/badge.svg)
38
+
39
+
40
+ <p align="center">
41
+ <img src="assets/demo.gif" alt="Centered Demo" />
42
+ </p>
43
+
44
+
45
+ *An example of baked images. (Each object is a layer and an annotation will also be extracted for all layers.)*
46
+
47
+ Let's bake an image.
48
+
49
+ ## Why is it relevant?
50
+
51
+ When training computer vision models (especially for detection and segmentation), labeling large amounts of data is crucial for better model performance. Often, the process involves multiple cycles of labeling, training, and evaluation. By generating multiple realistic labeled datasets from a single image, the time spent on labeling can be significantly reduced.
52
+
53
+ ## What's up with the name?
54
+ The concept involves extracting portions of an image (e.g., objects of interest) using tools like polygons or models such as Segment Anything. These extractions are treated as layers, which can then be copied, pasted, and manipulated to create multiple instances of the desired object. By combining these layers step by step, a new labeled image with annotations in JSON format is created. The term "baking" refers to the process of merging these layers into a single cohesive image.
55
+
56
+ ## Getting Started
57
+ ### Installation
58
+ #### Using PIP
59
+ This project is also available on the PyPI server.
60
+
61
+ ```bash
62
+ pip install imagebaker
63
+ ```
64
+
65
+ #### Developing
66
+ Please, clone this repository and install it locally:
67
+
68
+ ```bash
69
+ git clone https://github.com/q-viper/image-baker.git
70
+ cd image-baker
71
+ pip install -e .
72
+ ```
73
+
74
+ ### First Run
75
+ Run the following command to launch the GUI:
76
+
77
+ `imagebaker`
78
+
79
+ By default, the above command will not run any models on the backend. So please take a look into the example of model definition at [examples/loaded_models.py](examples/loaded_models.py). Then we need to pass it as:
80
+
81
+ `imagebaker --models-file examples/loaded_models.py`
82
+
83
+ For more options, please do: `imagebaker --help` It should give the following options.
84
+
85
+ ![](assets/demo/options.png)
86
+
87
+
88
+ * **`--configs-file`** allows us to define custom configs. The custom configs have to inherit LayerConfig and CanvasConfig defined at [imagebaker/core/configs/configs.py](imagebaker/core/configs/configs.py). An example is available at [examples](examples/).
89
+
90
+ After cloning and going to the project directory, the following code should work.
91
+ `imagebaker --models-file examples/loaded_models.py --configs-file examples/example_config.py`
92
+
93
+ ## Features
94
+ - **Annotating Images**: Load a folder of images and annotate them using bounding boxes or polygons.
95
+ - **Model Testing**: Define models for detection, segmentation, and prompts (e.g., points or rectangles) by following the base model structure in [imagebaker/models/base_model.py](imagebaker/models/base_model.py). See [examples/loaded_models.py](examples/loaded_models.py) for a working example.
96
+ - **Layerifying**: Crop images based on annotations to create reusable layers. Each cropped image represents a single layer.
97
+ - **Baking States**: Arrange layers to create image variations by dragging, rotating, adjusting opacity, and more. Save the state using the Save State button or Ctrl + S.
98
+ - **Playing States**: Replay saved states, export them locally, or use them for further predictions.
99
+ - **Exporting States**: Export the final annotated JSON and the baked multilayer image.
100
+
101
+ ### Shortcuts
102
+ * **Ctrl + C**: Copy selected annotation/layer.
103
+ * **Ctrl + V**: Paste copied annotation/layer in its parent image/layer if it is currently open.
104
+ * **Delete**: Delete selected annotation/layer.
105
+ * **Left Click**: Select an annotation/layer on mouse position.
106
+ * **Left Click + Drag**: Drag a selected annotation/layer.
107
+ * **Double Left Click**: When using polygon annotation, completes the polygon.
108
+ * **Right Click**: Deselect an annotation/layer. While annotating the polygon, undo the last point.
109
+ * **Ctrl + Mouse Wheel**: Zoom In/Out on the mouse position, i.e., resize the viewport.
110
+ * **Ctrl + Drag**: If done on the background, the viewport is panned.
111
+ * **Ctrl + S**: Save State on Baker Tab.
112
+ * **Ctrl + D**: Draw Mode on Baker Tab. Drawing can happen on a selected or main layer.
113
+ * **Ctrl + E**: Erase Mode on Baker Tab.
114
+ * **Wheel**: Change the size of the drawing pointer.
115
+
116
+ ## Demo
117
+ ### Annotation Page
118
+ This is where the loading of the image folder and annotation, connection with the model running in the backend, and layerifying happen.
119
+
120
+ ![](assets/demo/annotation_page.png)
121
+
122
+ ### Baker Page
123
+ This is where the layer baking happens. And the extraction of the layers as well.
124
+
125
+ ![](assets/demo/baker_page.png)
126
+
127
+ An example of drawing:
128
+
129
+ ![](assets/demo/drawing.png)
130
+
131
+ ### Annotated
132
+
133
+ The JSON and the baked image will be exported to the local folder, and in debug mode, the annotations and the mask for each layer will be exported too.
134
+
135
+ ![](assets/demo/annotated_veg_smiley.png)
136
+
137
+ ### Demo Video
138
+
139
+ To see the tool in action, check out the demo video below:
140
+
141
+
142
+ [![Demo Video](https://img.youtube.com/vi/WckMT0r-2Lc/0.jpg)](https://youtu.be/WckMT0r-2Lc)
143
+
144
+
145
+ Click on the image above to play the video on YouTube.
146
+
147
+
148
+ ## Contributions
149
+
150
+
151
+ Contributions are welcome!
152
+
153
+ Do you find this project to be useful and are you looking for some features that are not implemented yet? Feel free to open issues or submit pull requests to improve the project.
@@ -0,0 +1,123 @@
1
+ # Image-Baker
2
+ ![Dependabot Status](https://img.shields.io/badge/dependabot-active-brightgreen)
3
+ ![GitHub License](https://img.shields.io/github/license/q-viper/image-baker)
4
+ ![commit activity](https://img.shields.io/github/commit-activity/w/q-viper/SmokeSim/master)
5
+ ![code size in bytes](https://img.shields.io/github/languages/code-size/q-viper/image-baker)
6
+ <!-- ![Tests](https://github.com/q-viper/SmokeSim/actions/workflows/test-on-push.yml/badge.svg) -->
7
+ ![Code Formatting](https://github.com/q-viper/image-baker/actions/workflows/black-formatter.yml/badge.svg)
8
+
9
+
10
+ <p align="center">
11
+ <img src="assets/demo.gif" alt="Centered Demo" />
12
+ </p>
13
+
14
+
15
+ *An example of baked images. (Each object is a layer and an annotation will also be extracted for all layers.)*
16
+
17
+ Let's bake an image.
18
+
19
+ ## Why is it relevant?
20
+
21
+ When training computer vision models (especially for detection and segmentation), labeling large amounts of data is crucial for better model performance. Often, the process involves multiple cycles of labeling, training, and evaluation. By generating multiple realistic labeled datasets from a single image, the time spent on labeling can be significantly reduced.
22
+
23
+ ## What's up with the name?
24
+ The concept involves extracting portions of an image (e.g., objects of interest) using tools like polygons or models such as Segment Anything. These extractions are treated as layers, which can then be copied, pasted, and manipulated to create multiple instances of the desired object. By combining these layers step by step, a new labeled image with annotations in JSON format is created. The term "baking" refers to the process of merging these layers into a single cohesive image.
25
+
26
+ ## Getting Started
27
+ ### Installation
28
+ #### Using PIP
29
+ This project is also available on the PyPI server.
30
+
31
+ ```bash
32
+ pip install imagebaker
33
+ ```
34
+
35
+ #### Developing
36
+ Please, clone this repository and install it locally:
37
+
38
+ ```bash
39
+ git clone https://github.com/q-viper/image-baker.git
40
+ cd image-baker
41
+ pip install -e .
42
+ ```
43
+
44
+ ### First Run
45
+ Run the following command to launch the GUI:
46
+
47
+ `imagebaker`
48
+
49
+ By default, the above command will not run any models on the backend. So please take a look into the example of model definition at [examples/loaded_models.py](examples/loaded_models.py). Then we need to pass it as:
50
+
51
+ `imagebaker --models-file examples/loaded_models.py`
52
+
53
+ For more options, please do: `imagebaker --help` It should give the following options.
54
+
55
+ ![](assets/demo/options.png)
56
+
57
+
58
+ * **`--configs-file`** allows us to define custom configs. The custom configs have to inherit LayerConfig and CanvasConfig defined at [imagebaker/core/configs/configs.py](imagebaker/core/configs/configs.py). An example is available at [examples](examples/).
59
+
60
+ After cloning and going to the project directory, the following code should work.
61
+ `imagebaker --models-file examples/loaded_models.py --configs-file examples/example_config.py`
62
+
63
+ ## Features
64
+ - **Annotating Images**: Load a folder of images and annotate them using bounding boxes or polygons.
65
+ - **Model Testing**: Define models for detection, segmentation, and prompts (e.g., points or rectangles) by following the base model structure in [imagebaker/models/base_model.py](imagebaker/models/base_model.py). See [examples/loaded_models.py](examples/loaded_models.py) for a working example.
66
+ - **Layerifying**: Crop images based on annotations to create reusable layers. Each cropped image represents a single layer.
67
+ - **Baking States**: Arrange layers to create image variations by dragging, rotating, adjusting opacity, and more. Save the state using the Save State button or Ctrl + S.
68
+ - **Playing States**: Replay saved states, export them locally, or use them for further predictions.
69
+ - **Exporting States**: Export the final annotated JSON and the baked multilayer image.
70
+
71
+ ### Shortcuts
72
+ * **Ctrl + C**: Copy selected annotation/layer.
73
+ * **Ctrl + V**: Paste copied annotation/layer in its parent image/layer if it is currently open.
74
+ * **Delete**: Delete selected annotation/layer.
75
+ * **Left Click**: Select an annotation/layer on mouse position.
76
+ * **Left Click + Drag**: Drag a selected annotation/layer.
77
+ * **Double Left Click**: When using polygon annotation, completes the polygon.
78
+ * **Right Click**: Deselect an annotation/layer. While annotating the polygon, undo the last point.
79
+ * **Ctrl + Mouse Wheel**: Zoom In/Out on the mouse position, i.e., resize the viewport.
80
+ * **Ctrl + Drag**: If done on the background, the viewport is panned.
81
+ * **Ctrl + S**: Save State on Baker Tab.
82
+ * **Ctrl + D**: Draw Mode on Baker Tab. Drawing can happen on a selected or main layer.
83
+ * **Ctrl + E**: Erase Mode on Baker Tab.
84
+ * **Wheel**: Change the size of the drawing pointer.
85
+
86
+ ## Demo
87
+ ### Annotation Page
88
+ This is where the loading of the image folder and annotation, connection with the model running in the backend, and layerifying happen.
89
+
90
+ ![](assets/demo/annotation_page.png)
91
+
92
+ ### Baker Page
93
+ This is where the layer baking happens. And the extraction of the layers as well.
94
+
95
+ ![](assets/demo/baker_page.png)
96
+
97
+ An example of drawing:
98
+
99
+ ![](assets/demo/drawing.png)
100
+
101
+ ### Annotated
102
+
103
+ The JSON and the baked image will be exported to the local folder, and in debug mode, the annotations and the mask for each layer will be exported too.
104
+
105
+ ![](assets/demo/annotated_veg_smiley.png)
106
+
107
+ ### Demo Video
108
+
109
+ To see the tool in action, check out the demo video below:
110
+
111
+
112
+ [![Demo Video](https://img.youtube.com/vi/WckMT0r-2Lc/0.jpg)](https://youtu.be/WckMT0r-2Lc)
113
+
114
+
115
+ Click on the image above to play the video on YouTube.
116
+
117
+
118
+ ## Contributions
119
+
120
+
121
+ Contributions are welcome!
122
+
123
+ Do you find this project to be useful and are you looking for some features that are not implemented yet? Feel free to open issues or submit pull requests to improve the project.
@@ -1,3 +1,5 @@
1
1
  from loguru import logger # noqa
2
2
 
3
3
  logger.info("imagebaker package loaded with loguru logger.")
4
+
5
+ __version__ = "0.0.4" # noqa
@@ -0,0 +1,153 @@
1
+ Metadata-Version: 2.4
2
+ Name: imagebaker
3
+ Version: 0.0.41
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
+
31
+ # Image-Baker
32
+ ![Dependabot Status](https://img.shields.io/badge/dependabot-active-brightgreen)
33
+ ![GitHub License](https://img.shields.io/github/license/q-viper/image-baker)
34
+ ![commit activity](https://img.shields.io/github/commit-activity/w/q-viper/SmokeSim/master)
35
+ ![code size in bytes](https://img.shields.io/github/languages/code-size/q-viper/image-baker)
36
+ <!-- ![Tests](https://github.com/q-viper/SmokeSim/actions/workflows/test-on-push.yml/badge.svg) -->
37
+ ![Code Formatting](https://github.com/q-viper/image-baker/actions/workflows/black-formatter.yml/badge.svg)
38
+
39
+
40
+ <p align="center">
41
+ <img src="assets/demo.gif" alt="Centered Demo" />
42
+ </p>
43
+
44
+
45
+ *An example of baked images. (Each object is a layer and an annotation will also be extracted for all layers.)*
46
+
47
+ Let's bake an image.
48
+
49
+ ## Why is it relevant?
50
+
51
+ When training computer vision models (especially for detection and segmentation), labeling large amounts of data is crucial for better model performance. Often, the process involves multiple cycles of labeling, training, and evaluation. By generating multiple realistic labeled datasets from a single image, the time spent on labeling can be significantly reduced.
52
+
53
+ ## What's up with the name?
54
+ The concept involves extracting portions of an image (e.g., objects of interest) using tools like polygons or models such as Segment Anything. These extractions are treated as layers, which can then be copied, pasted, and manipulated to create multiple instances of the desired object. By combining these layers step by step, a new labeled image with annotations in JSON format is created. The term "baking" refers to the process of merging these layers into a single cohesive image.
55
+
56
+ ## Getting Started
57
+ ### Installation
58
+ #### Using PIP
59
+ This project is also available on the PyPI server.
60
+
61
+ ```bash
62
+ pip install imagebaker
63
+ ```
64
+
65
+ #### Developing
66
+ Please, clone this repository and install it locally:
67
+
68
+ ```bash
69
+ git clone https://github.com/q-viper/image-baker.git
70
+ cd image-baker
71
+ pip install -e .
72
+ ```
73
+
74
+ ### First Run
75
+ Run the following command to launch the GUI:
76
+
77
+ `imagebaker`
78
+
79
+ By default, the above command will not run any models on the backend. So please take a look into the example of model definition at [examples/loaded_models.py](examples/loaded_models.py). Then we need to pass it as:
80
+
81
+ `imagebaker --models-file examples/loaded_models.py`
82
+
83
+ For more options, please do: `imagebaker --help` It should give the following options.
84
+
85
+ ![](assets/demo/options.png)
86
+
87
+
88
+ * **`--configs-file`** allows us to define custom configs. The custom configs have to inherit LayerConfig and CanvasConfig defined at [imagebaker/core/configs/configs.py](imagebaker/core/configs/configs.py). An example is available at [examples](examples/).
89
+
90
+ After cloning and going to the project directory, the following code should work.
91
+ `imagebaker --models-file examples/loaded_models.py --configs-file examples/example_config.py`
92
+
93
+ ## Features
94
+ - **Annotating Images**: Load a folder of images and annotate them using bounding boxes or polygons.
95
+ - **Model Testing**: Define models for detection, segmentation, and prompts (e.g., points or rectangles) by following the base model structure in [imagebaker/models/base_model.py](imagebaker/models/base_model.py). See [examples/loaded_models.py](examples/loaded_models.py) for a working example.
96
+ - **Layerifying**: Crop images based on annotations to create reusable layers. Each cropped image represents a single layer.
97
+ - **Baking States**: Arrange layers to create image variations by dragging, rotating, adjusting opacity, and more. Save the state using the Save State button or Ctrl + S.
98
+ - **Playing States**: Replay saved states, export them locally, or use them for further predictions.
99
+ - **Exporting States**: Export the final annotated JSON and the baked multilayer image.
100
+
101
+ ### Shortcuts
102
+ * **Ctrl + C**: Copy selected annotation/layer.
103
+ * **Ctrl + V**: Paste copied annotation/layer in its parent image/layer if it is currently open.
104
+ * **Delete**: Delete selected annotation/layer.
105
+ * **Left Click**: Select an annotation/layer on mouse position.
106
+ * **Left Click + Drag**: Drag a selected annotation/layer.
107
+ * **Double Left Click**: When using polygon annotation, completes the polygon.
108
+ * **Right Click**: Deselect an annotation/layer. While annotating the polygon, undo the last point.
109
+ * **Ctrl + Mouse Wheel**: Zoom In/Out on the mouse position, i.e., resize the viewport.
110
+ * **Ctrl + Drag**: If done on the background, the viewport is panned.
111
+ * **Ctrl + S**: Save State on Baker Tab.
112
+ * **Ctrl + D**: Draw Mode on Baker Tab. Drawing can happen on a selected or main layer.
113
+ * **Ctrl + E**: Erase Mode on Baker Tab.
114
+ * **Wheel**: Change the size of the drawing pointer.
115
+
116
+ ## Demo
117
+ ### Annotation Page
118
+ This is where the loading of the image folder and annotation, connection with the model running in the backend, and layerifying happen.
119
+
120
+ ![](assets/demo/annotation_page.png)
121
+
122
+ ### Baker Page
123
+ This is where the layer baking happens. And the extraction of the layers as well.
124
+
125
+ ![](assets/demo/baker_page.png)
126
+
127
+ An example of drawing:
128
+
129
+ ![](assets/demo/drawing.png)
130
+
131
+ ### Annotated
132
+
133
+ The JSON and the baked image will be exported to the local folder, and in debug mode, the annotations and the mask for each layer will be exported too.
134
+
135
+ ![](assets/demo/annotated_veg_smiley.png)
136
+
137
+ ### Demo Video
138
+
139
+ To see the tool in action, check out the demo video below:
140
+
141
+
142
+ [![Demo Video](https://img.youtube.com/vi/WckMT0r-2Lc/0.jpg)](https://youtu.be/WckMT0r-2Lc)
143
+
144
+
145
+ Click on the image above to play the video on YouTube.
146
+
147
+
148
+ ## Contributions
149
+
150
+
151
+ Contributions are welcome!
152
+
153
+ Do you find this project to be useful and are you looking for some features that are 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.41"
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
+ ]
imagebaker-0.0.3/PKG-INFO DELETED
@@ -1,83 +0,0 @@
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
- # Image-Baker
16
-
17
- Let's bake an image.
18
-
19
- ## Why is it relevant?
20
-
21
- When training computer vision models (especially for detection and segmentation), labeling large amounts of data is crucial for better model performance. Often, the process involves multiple cycles of labeling, training, and evaluation. By generating multiple realistic labeled datasets from a single image, the time spent on labeling can be significantly reduced.
22
-
23
- ## What's up with the name?
24
-
25
- The concept involves extracting portions of an image (e.g., objects of interest) using tools like polygons or models such as Segment Anything. These extractions are treated as layers, which can then be copied, pasted, and manipulated to create multiple instances of the desired object. By combining these layers step by step, a new labeled image with annotations in JSON format is created. The term "Baking" refers to the process of merging these layers into a single cohesive image.
26
-
27
- ## Getting Started
28
-
29
- ### Installation
30
-
31
- #### Using PIP
32
-
33
- ```bash
34
- pip install imagebaker
35
- ```
36
-
37
- #### Developing
38
-
39
- Clone this repository and install it locally:
40
-
41
- ```bash
42
- pip install -e .
43
- ```
44
-
45
- ### First Run
46
-
47
- Run the following command to launch the GUI:
48
-
49
- ```bash
50
- imagebaker
51
- ```
52
-
53
- If the command does not work, try running the example script:
54
-
55
- ```bash
56
- python examples/app.py
57
- ```
58
-
59
- ## Features
60
-
61
- - **Annotating Images**: Load a folder of images and annotate them using bounding boxes or polygons.
62
- - **Model Testing**: Define models for detection, segmentation, and prompts (e.g., points or rectangles) by following the base model structure in [imagebaker/models/base_model.py](imagebaker/models/base_model.py). See [examples/loaded_models.py](examples/loaded_models.py) for a working example.
63
- - **Layerifying**: Crop images based on annotations to create reusable layers. Each cropped image represents a single layer.
64
- - **Baking States**: Arrange layers to create image variations by dragging, rotating, adjusting opacity, and more. Save the state using the **Save State** button or **Ctrl + S**.
65
- - **Playing States**: Replay saved states, export them locally, or use them for further predictions.
66
- - **Exporting States**: Export the final annotated JSON and the baked multilayer image.
67
-
68
- ### Shortcuts
69
- * **Ctrl + C**: Copy selected annotation/layer.
70
- * **Ctrl + V**: Paste copied annotation/layer in its parent image/layer if it is currently open.
71
- * **Delete**: Delete selected annotation/layer.
72
- * **Left Click**: Select an annotation/layer on mouse position.
73
- * **Left Click + Drag**: Drag a selected annotation/layer.
74
- * **Double Left Click**: When using Polygon annotation, completes the polygon.
75
- * **Right Click**: Deselect an annotation/layer. While on annotating polygon, undo last point.
76
- * **Ctrl + Mouse Wheel**: Zoom In/Out on the mouse position i.e. resizes the viewport.
77
- * **Ctrl + Drag**: If done on the background, the viewport is panned.
78
- * **Ctrl + S**: Save State.
79
-
80
-
81
- ## Contributions
82
-
83
- Contributions are welcome! Feel free to open issues or submit pull requests to improve the project.
@@ -1,69 +0,0 @@
1
- # Image-Baker
2
-
3
- Let's bake an image.
4
-
5
- ## Why is it relevant?
6
-
7
- When training computer vision models (especially for detection and segmentation), labeling large amounts of data is crucial for better model performance. Often, the process involves multiple cycles of labeling, training, and evaluation. By generating multiple realistic labeled datasets from a single image, the time spent on labeling can be significantly reduced.
8
-
9
- ## What's up with the name?
10
-
11
- The concept involves extracting portions of an image (e.g., objects of interest) using tools like polygons or models such as Segment Anything. These extractions are treated as layers, which can then be copied, pasted, and manipulated to create multiple instances of the desired object. By combining these layers step by step, a new labeled image with annotations in JSON format is created. The term "Baking" refers to the process of merging these layers into a single cohesive image.
12
-
13
- ## Getting Started
14
-
15
- ### Installation
16
-
17
- #### Using PIP
18
-
19
- ```bash
20
- pip install imagebaker
21
- ```
22
-
23
- #### Developing
24
-
25
- Clone this repository and install it locally:
26
-
27
- ```bash
28
- pip install -e .
29
- ```
30
-
31
- ### First Run
32
-
33
- Run the following command to launch the GUI:
34
-
35
- ```bash
36
- imagebaker
37
- ```
38
-
39
- If the command does not work, try running the example script:
40
-
41
- ```bash
42
- python examples/app.py
43
- ```
44
-
45
- ## Features
46
-
47
- - **Annotating Images**: Load a folder of images and annotate them using bounding boxes or polygons.
48
- - **Model Testing**: Define models for detection, segmentation, and prompts (e.g., points or rectangles) by following the base model structure in [imagebaker/models/base_model.py](imagebaker/models/base_model.py). See [examples/loaded_models.py](examples/loaded_models.py) for a working example.
49
- - **Layerifying**: Crop images based on annotations to create reusable layers. Each cropped image represents a single layer.
50
- - **Baking States**: Arrange layers to create image variations by dragging, rotating, adjusting opacity, and more. Save the state using the **Save State** button or **Ctrl + S**.
51
- - **Playing States**: Replay saved states, export them locally, or use them for further predictions.
52
- - **Exporting States**: Export the final annotated JSON and the baked multilayer image.
53
-
54
- ### Shortcuts
55
- * **Ctrl + C**: Copy selected annotation/layer.
56
- * **Ctrl + V**: Paste copied annotation/layer in its parent image/layer if it is currently open.
57
- * **Delete**: Delete selected annotation/layer.
58
- * **Left Click**: Select an annotation/layer on mouse position.
59
- * **Left Click + Drag**: Drag a selected annotation/layer.
60
- * **Double Left Click**: When using Polygon annotation, completes the polygon.
61
- * **Right Click**: Deselect an annotation/layer. While on annotating polygon, undo last point.
62
- * **Ctrl + Mouse Wheel**: Zoom In/Out on the mouse position i.e. resizes the viewport.
63
- * **Ctrl + Drag**: If done on the background, the viewport is panned.
64
- * **Ctrl + S**: Save State.
65
-
66
-
67
- ## Contributions
68
-
69
- Contributions are welcome! Feel free to open issues or submit pull requests to improve the project.