https://github.com/chekoduadarsh/padded-image-resizer
Image Resizer Desinged for DL project which can resize the image keeping aspect ratio!!
https://github.com/chekoduadarsh/padded-image-resizer
aspect-ratio data-preprocessing dataset image-resizer opencv python3
Last synced: about 2 months ago
JSON representation
Image Resizer Desinged for DL project which can resize the image keeping aspect ratio!!
- Host: GitHub
- URL: https://github.com/chekoduadarsh/padded-image-resizer
- Owner: chekoduadarsh
- Created: 2020-02-15T13:33:44.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-16T06:02:47.000Z (over 5 years ago)
- Last Synced: 2025-02-08T15:48:05.238Z (4 months ago)
- Topics: aspect-ratio, data-preprocessing, dataset, image-resizer, opencv, python3
- Language: Python
- Homepage:
- Size: 758 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Padded Image Resizer
This library can resize image while keeping the aspect ratio as it is and will add padding to reach the target size. This library is mainly designed to used fro data preprocessing tool for deep leanrning algorithms, due to images obtained from online sources will have diferent aspect ratio and size.
## Implimentation
clone/download the repository to your working/local directory
```
git clone https://github.com/chekoduadarsh/Padded-Image-Resizer
```
### Bulk Resize
```python3
from padded_image_resizer import bulk_resizer
bulk_resizer(input_path="path/to/input/image/directory",output_path="path/to/output/directory",desired_size=32,color=[0,0,0],rename = True)
```
This will resize and convert all the image files in the given dirctory to given size in `desired_size` with a padding color given in `color` given as [B,G,R]. If `rename` is enabled this will rename all the files in non repeating whole number series### Resize
```python3
from padded_image_resizer import resizer
resizer(im_pth="path/to/input/image/directory/image.png",output_path="path/to/output/directory",desired_size=32,color=[0,0,0],rename = True)
```
This is similar to bulk resize, rather than input folder path we will be giving image path in `im_pth` and `rename` will rename the file to 0