lreal commited on
Commit
bfb442a
·
verified ·
1 Parent(s): 5294e52

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -27,8 +27,8 @@ If you would like to use the same workflow I used, here is each repository liste
27
 
28
  **Design process (Each step explained)**
29
  - Web scraping: For this dataset, I used Bing images as it tends to be less restrictive that Google images (also supported by iCrawler), in a future dataset, different Google image results can be added to the dataset for a larger set of images
30
- - Identifying duplicates: This was a pretty obvious choice, as it has a very high likelyhood of identifying exact duplicates because of its derivation from the file's bytes
31
- - Removing watermark banners: This had some design iterations, from looking for large areas with color difference in OpenCV, to using text detection, but ultimately how the algorithm works is that it will convert the image to greyscale, then check if the bottom row of pixels in the image is greater than a set average darkness value, then each row above has its average darkness value computed, then once it reaches below a percentage of the first row's darkness value, it will crop to that height. A maximum crop height is also implemented for safety.
32
  - Watermark detection: This was inspired from [this](https://huggingface.co/spaces/fancyfeast/joycaption-watermark-detection) huggingface repo, and was adapted to work on large datasets with optimized performance for CUDA enabled devices. I also implemented batching for parallel processing, speeding up inference by many times on datasets like this one.
33
  - Watermark removal: This was also reused from a LAMA-based project called [IOPaint](https://www.iopaint.com/), where I modified the source code to have the CLI command (iopaint run) work with large datasets, and support nested directories and a preserved directory output, as well as implemented parallel computing for quicker inpainting on the entire dataset.
34
  - VLM Screening: This was originally not going to be included, but I noticed a lot of the methods above did not do enough to clean up the dataset. Since this is a very lengthy inference (took 30 hours in total to run on this dataset), this is run at the very end when quicker algorithms and inference can be run to make the job of the VLM easier. I already was familiar with Ollama and it's strong API, and had it running locally so this was pretty easy to implement. The first model I tried was LLaVA, however the results from this were a lackluster, as it did not seem to follow prompts and was either completely wrong, or hesitant. I used the qwen2.5vl model, and found much better results, where it resolved the mentioned issues. Memory usage was also an issue as more and more images were being base64 encoded, so I made sure to also add several several garbage collection calls as well as deleting the unused variables, at the end it took up less than 4GB at 60k images processed.
 
27
 
28
  **Design process (Each step explained)**
29
  - Web scraping: For this dataset, I used Bing images as it tends to be less restrictive that Google images (also supported by iCrawler), in a future dataset, different Google image results can be added to the dataset for a larger set of images
30
+ - Identifying duplicates: Using MD5 hash comparison is a pretty obvious choice, as it has a very high likelyhood of identifying exact duplicates because of its derivation from the file's bytes
31
+ - Removing watermark banners: This had some design iterations, from looking for large areas with color difference in OpenCV, to using text detection, but ultimately how the algorithm works is that it will convert the image to greyscale, then check if the bottom row of pixels in the image is greater than a set average darkness value, then each row above has its average darkness value computed, once it reaches below a percentage of the first row's darkness value, it will crop to that height. A maximum crop height is also implemented for safety.
32
  - Watermark detection: This was inspired from [this](https://huggingface.co/spaces/fancyfeast/joycaption-watermark-detection) huggingface repo, and was adapted to work on large datasets with optimized performance for CUDA enabled devices. I also implemented batching for parallel processing, speeding up inference by many times on datasets like this one.
33
  - Watermark removal: This was also reused from a LAMA-based project called [IOPaint](https://www.iopaint.com/), where I modified the source code to have the CLI command (iopaint run) work with large datasets, and support nested directories and a preserved directory output, as well as implemented parallel computing for quicker inpainting on the entire dataset.
34
  - VLM Screening: This was originally not going to be included, but I noticed a lot of the methods above did not do enough to clean up the dataset. Since this is a very lengthy inference (took 30 hours in total to run on this dataset), this is run at the very end when quicker algorithms and inference can be run to make the job of the VLM easier. I already was familiar with Ollama and it's strong API, and had it running locally so this was pretty easy to implement. The first model I tried was LLaVA, however the results from this were a lackluster, as it did not seem to follow prompts and was either completely wrong, or hesitant. I used the qwen2.5vl model, and found much better results, where it resolved the mentioned issues. Memory usage was also an issue as more and more images were being base64 encoded, so I made sure to also add several several garbage collection calls as well as deleting the unused variables, at the end it took up less than 4GB at 60k images processed.