Shape generate
The file shape_generate.py has multiple functionality to create synthetic dataset
of symmetrical objects. The methods creates two folders, namely, images and masks. The images are constructed from the Gaussain distribution.
Installation
This repo is managed with poetry. To try out this package, do:
$ poetry install
$ poetry run symmsyn --help
Examples
The following examples show the method to create the dataset
- Create a dataset of
200images of size=256 x 256 with circle objects of radius=10and density=20
poetry run symmsyn --job_type "single" --n_image 200 --folder_name "circle_data" --object_type "circle" --image_dims 256 --circle_radius 10 --start_count 45 --end_count 50
- Create a dataset of
100images of size=512 x 512 with square objects of side=10, density=35
poetry run symmsyn --job_type "single" --n_image 100 --folder_name "square_data" --object_type "square" --image_dims 512 --start_count 34 --end_count 35 --square_size 10 10
- Create a dataset of
100images of size=512 x 512 with triangle objects of varying size, density=35
poetry run symmsyn --job_type "single" --n_image 100 --folder_name "triangle_data" --object_type "triangle" --image_dims 512 --start_count 34 --end_count 35 --size_vary True
- Create a dataset of
500images of size=256 x 256 with circle+ellipse objects of radius=10, minor_radius=5, major_radius=10, circle density=35, ellipse density=10
The elliptical objects will be equally divided into horizontal and angular objects. Specify angle parameter if needed.
poetry run symmsyn --job_type "multi" --n_image 100 --folder_name "circle_ellipse_data" --image_dims 256 --circle_radius 10 --circle_start 34 --circle_end 35 --add_ellipse True --ell_count 10 --m_radius 10 --n_radius 5 --ell_angle 45
- Create a dataset of
500images of size=256 x 256 with circle+ellipse+triangle objects of varying sizes and circle density=10, ellipse density=10, triangle density=40
The elliptical objects will be equally divided into horizontal and angular objects. Specify angle parameter if needed.
poetry run symmsyn --job_type "multi" --n_image 500 --folder_name "circle_ellipse_tri_data" --image_dims 256 --circle_start 9 --circle_end 10 --add_tri True --add_ellipse True --tri_count 40 --ell_count 10 --size_vary True
- Create a dataset of
500images of size=256 x 256 with circle+square+triangle objects of radius=10, side=10, size=12and circle density=10, square density=10, triangle density=15and change the intensity of objects to0.5*std.of the background
To change from square to rectangle objects vary the values in the parameter size, a good starting value (-8,12)
poetry run symmsyn --job_type "multi" --n_image 500 --folder_name "circle_square_tri_data" --image_dims 256 --circle_radius 10 --circle_start 9 --circle_end 10 --add_square True --add_tri True --square_size 10 10 --tri_size 12 12 --sq_count 10 --tri_count 15 --intensity_vary True --intensity_ratio 0.5
- Create only an image and mask size=256 x 256 with circle+square+triangle objects of radius=10,side=10, size=12 and circle density=10, square density=10, triangle density=15
The image and mask are saved as a file "multi.png"
To change from square to rectangle objects vary the values in the parameter size, a good starting value (-8,12)
poetry run symmsyn --job_type "multi" --image_dims 256 --circle_radius 10 --circle_start 9 --circle_end 10 --add_square True --add_tri True --square_size 10 10 --tri_size 12 12 --sq_count 10 --tri_count 15 --save_file False
=================================================================================================================================================================
Some example images are shown here.
The datasets in the order from left to right: circle objects, circle and ellipse, circle and square, circle, ellipse and triangle objects.
An example of circle, ellipse and triangle object dataset with the variation of signal to noise.
Release files for symmetric-synthetic 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| symmetric_synthetic-0.1.0.tar.gz | 10.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| symmetric_synthetic-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.7 kB
Release files / symmetric_synthetic-0.1.0.tar.gz
| Download URL | symmetric_synthetic-0.1.0.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e669d882ffabfa7fc641f9464611f61191416e674a22605b70fde9412d5fb645
|
|
BLAKE2b-256 checksum How to use checksums |
8f87459673ebc6bc3c08e03f35095a0854e46016bafd8942dcfe043568c18e95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.0 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.9
|
Release files / symmetric_synthetic-0.1.0-py3-none-any.whl
| Download URL | symmetric_synthetic-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47d567f9d34d981f1ccb90fb651060e175ba9b8e4dd761345ac965103a20fb1b
|
|
BLAKE2b-256 checksum How to use checksums |
df478829d89e670435c3483569d9fc2e257631d421dee0b6b4ef89eddf8b8233
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.0 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.9
|