Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
hakanaktas1 committed May 25, 2023
1 parent 40e5576 commit 133e232
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,23 @@ pip install .
* Customizable augmentation parameters, including rotation angle, scaling factor, flipping direction, and more.

* Supports augmentation of multiple images and annotation files in batch mode.


```python
from aug_tool import Augmentation

# Specify the input parameters
open_file_name = r"C:\Users\user.name\Desktop\datas\org" #Path to the data folder
save_file_name = r"C:\Users\user.name\Desktop\datas\augmented"#Path to the data folder

number_of_aug = 2 # Number of augmented data to generate

# Apply data augmentation using aug-tool
Augmentation(open_data_path=open_file_name,
save_file_name=save_file_name,
number_of_aug=number_of_aug,
x_shift=15,
y_shift=15)

# Continue with further processing or analysis
```
9 changes: 4 additions & 5 deletions src/aug-tool/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import glob


class Factory(object):
class Augmentation(object):
def __init__(self, open_data_path:str, save_file_name:str, number_of_aug:int, x_shift:int, y_shift:int) -> None:
self.open_data_path = open_data_path
self.save_file_name = save_file_name
Expand Down Expand Up @@ -89,7 +89,6 @@ def create_list_of_data(open_data_path) -> list:
read the data from this file and return it as a list
"""
try:
raise Exception("foto asdasd")
image_extensions = ['.jpg', '.jpeg', '.png']
image_files = []

Expand All @@ -104,7 +103,7 @@ def create_list_of_data(open_data_path) -> list:

return image_files
except:
logging.exception('Deneme Okta kardesim icin')
logging.exception('')


@property
Expand Down Expand Up @@ -137,9 +136,9 @@ def image_factory(self, path:str):
open_file_name = r"C:\Users\hakan.aktas\Desktop\save\animal1"
save_file_name = r"C:\Users\hakan.aktas\Desktop\save\animal2"

number_of_aug = 2,
number_of_aug = 2

Factory(open_data_path=open_file_name,
Augmentation(open_data_path=open_file_name,
save_file_name=save_file_name,
number_of_aug=number_of_aug,
x_shift=33,
Expand Down

0 comments on commit 133e232

Please sign in to comment.