Skip to content

Commit ff66e3b

Browse files
authored
Update README.md
1 parent 93e7bf4 commit ff66e3b

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

README.md

+25-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
# iPhone Image Prepare for LoRA Training
22

3-
This script prepares iPhone images for LoRA (Low-Rank Adaptation) training by stripping metadata and optionally rotating images.
3+
This script prepares iPhone images for LoRA (Low-Rank Adaptation) training by addressing common issues with image orientation and metadata.
4+
5+
## Problem Statement
6+
7+
When training LoRA models with images from an iPhone, a common issue arises: the LoRA training process doesn't read the image metadata correctly, particularly the orientation information. This can result in training on images that appear rotated incorrectly. For example, a vertical image of a bottle might be processed as if it were lying on its side.
8+
9+
This script solves this problem by:
10+
1. Stripping the metadata from the images, including orientation information.
11+
2. Optionally rotating the images 90 degrees clockwise to ensure correct orientation.
12+
13+
By preprocessing your iPhone images with this script, you can ensure that your LoRA model trains on correctly oriented images, improving the quality and accuracy of your results.
414

515
## Features
616

7-
- Strips metadata from images
8-
- Optional 90-degree clockwise rotation
17+
- Strips metadata from images, resolving orientation issues
18+
- Optional 90-degree clockwise rotation to correct image orientation
919
- Supports various image formats (JPG, PNG, etc.)
1020
- Skips hidden files and non-image files
21+
- User-friendly prompts for input and output folders
1122

1223
## Requirements
1324

@@ -32,18 +43,19 @@ python iphone_image_prepare_for_lora.py
3243
```
3344

3445
Follow the prompts to enter:
35-
1. Input folder path
36-
2. Output folder path
37-
3. Whether to rotate images (y/n)
46+
1. Input folder path (where your original iPhone images are stored)
47+
2. Output folder path (where the processed images will be saved)
48+
3. Whether to rotate images (y/n) - use this if your images need 90-degree rotation
49+
50+
The script will process all valid images in the input folder and save the corrected versions to the output folder.
3851

39-
The script will process all valid images in the input folder and save them to the output folder.
52+
## Best Practices for LoRA Training
4053

41-
## Notes
54+
- Always check a sample of your processed images before training to ensure correct orientation.
55+
- If you notice images are still incorrectly oriented after processing, try running the script again with the rotation option set to the opposite of your previous choice.
56+
- Consistent image orientation is crucial for effective LoRA training, especially for models that are sensitive to object orientation (e.g., models for recognizing or generating specific objects or scenes).
4257

43-
- Ensure you have sufficient disk space in the output location.
44-
- The script preserves original filenames.
45-
- Invalid or non-image files are skipped with a notification.
4658

47-
## License
59+
## Contributing
4860

49-
This project is open source and available under the [MIT License](LICENSE).
61+
Contributions to improve the script or documentation are welcome. Please feel free to submit a pull request or open an issue if you have suggestions or encounter problems.

0 commit comments

Comments
 (0)