Image Synthesis Pipeline for Creation of dataset with cultural notions. (Step 4 for automatic VQA using BLIP model.) Refer Instructions, then Pipeline_Image_Synthesis.ipynb for step by step code.
Added API compatibility for inpainting method Follow instructions in notebook.
Python 3.10.12
2.4.1+cu121
stabilityai/stable-diffusion-2-inpainting: https://huggingface.co/stabilityai/stable-diffusion-2-inpainting
- (optional)
conda create -n synthesis-pipeline python=3.10.12 pip install diffusers transformers accelerate scipy safetensorspip install salesforce-lavis
pip install git+https://github.com/ostrolucky/Bulk-Bing-Image-downloader- Check "/ImageSynthPipeline/Input Image Pipeline/Step1_Image Scrapers" for instructions and scrape web for images that contain certain query
pip install opencv-python- Check "/ImageSynthPipeline/Input Image Pipeline/Step2_Image Face Detector" to filter images that contain people
- For extracting frames from YouTube,
pip install yt-dlp ffmpeg-python python-dotenv google-api-python-client. Ifffmpegis still not found, trysudo apt install ffmpeg- Make sure to keep your own YouTube Data API Key in
.envfile,YOUTUBE_API_KEY=<your_key>or directly pass the key as an argument to the command (not recommended).
- Make sure to keep your own YouTube Data API Key in
├── images
│ ├── Azerbaijani_Clothes
│ │ └── synthesized_images
│ │ ├── Asian
│ │ ├── Black
│ │ ├── Caucasian
│ │ └── Indian
│ ├── Korean_Food
│ │ ├── masks
│ │ ├── original_images
│ │ └── synthesized_images
│ │ ├── Asian
│ │ ├── Black
│ │ ├── Indian
│ │ └── White
│ ├── Myanmar_Clothes
│ │ ├── masks
│ │ ├── original_images
│ │ └── synthesized_images
│ │ ├── Asian
│ │ ├── Black
│ │ ├── Indian
│ │ └── White
│ ├── Myanmar_Food
│ │ ├── masks
│ │ ├── original_images
│ │ └── synthesized_images
│ │ ├── Asian
│ │ ├── Black
│ │ ├── Indian
│ │ └── White
│ ├── UK_Food
│ │ ├── masks
│ │ ├── original_images
│ │ └── synthesized_images
│ │ ├── Asian
│ │ ├── Black
│ │ ├── Indian
│ │ └── White
The format of image files are as follows:
- original image:
<original_country>_<type>_<index>.png - mask image:
<original_country>_<type>_<index>_mask.png - synthesized image:
<original_country>_<synthesized_race>_<type>_<index>.pngwheretypecan be eitherclothes,food, orfestivals.
- Limited 512x512 resolution
- Figure out checkpoint for inpainting. "x4-upscaling-ema.ckpt"
- Under construction (finish by sunday)