You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+25-13
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,24 @@
1
1
# iPhone Image Prepare for LoRA Training
2
2
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.
4
14
5
15
## Features
6
16
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
9
19
- Supports various image formats (JPG, PNG, etc.)
10
20
- Skips hidden files and non-image files
21
+
- User-friendly prompts for input and output folders
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.
38
51
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
40
53
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).
42
57
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.
46
58
47
-
## License
59
+
## Contributing
48
60
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