diff --git a/app.py b/app.py
index c03850238925b90eb5a3fc4e41866df7e48c42bc..5c6686997e60dca253937ec1c44f9077ac72631b 100644
--- a/app.py
+++ b/app.py
@@ -1,8 +1,8 @@
import argparse
-import spaces
+# import spaces
from visualcloze import VisualClozeModel
import gradio as gr
-import demo_tasks
+import examples
from functools import partial
from data.prefix_instruction import get_layout_instruction
from huggingface_hub import snapshot_download
@@ -15,11 +15,8 @@ default_grid_w = 3
default_upsampling_noise = 0.4
default_steps = 30
-GUIDANCE = """
-
-## 📧 Contact:
-Need help or have questions? Contact us at: lizhongyu [AT] mail.nankai.edu.cn.
+GUIDANCE = """
## 📋 Quick Start Guide:
1. Adjust **Number of In-context Examples**, 0 disables in-context learning.
@@ -41,6 +38,7 @@ When generating three images in a 3x4 grid, i.e., Image to Depth + Normal + Hed,
the runtime is approximately **110s**.
**Deploying locally with an 80G A100 can reduce the runtime by more than half.**
+### Note: For better quality, you can deploy the demo locally using the [model](https://huggingface.co/VisualCloze/VisualCloze/blob/main/visualcloze-512-lora.pth), which supports a higher resolution than this online demo, by following the instructions in the [GitHub repository](https://github.com/lzyhha/VisualCloze/tree/main?tab=readme-ov-file#2-web-demo-gradio).
"""
CITATION = r"""
@@ -53,13 +51,17 @@ If our work is useful for your research, please consider citing:
@article{li2025visualcloze,
title={VisualCloze: A Universal Image Generation Framework via Visual In-Context Learning},
author={Li, Zhong-Yu and Du, ruoyi and Yan, Juncheng and Zhuo, Le and Li, Zhen and Gao, Peng and Ma, Zhanyu and Cheng, Ming-Ming},
- booktitle={arXiv preprint arxiv:},
+ journal={arXiv preprint arxiv:},
year={2025}
}
```
📋 **License**
-This project is licensed under xxx.
+This project is licensed under apache-2.0.
+
+📧 **Contact**
+
+Need help or have questions? Contact us at: lizhongyu [AT] mail.nankai.edu.cn.
"""
NOTE = r"""
@@ -150,7 +152,7 @@ def create_demo(model):
steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=default_steps, step=1)
cfg = gr.Slider(label="CFG Scale", minimum=1.0, maximum=50.0, value=30, step=1)
upsampling_steps = gr.Slider(label="Upsampling steps (SDEdit)", minimum=1, maximum=100.0, value=10, step=1)
- upsampling_noise = gr.Slider(label="Upsampling noise (SDEdit)", minimum=0, maximum=1.0, value=default_upsampling_noise, step=0.01)
+ upsampling_noise = gr.Slider(label="Upsampling noise (SDEdit)", minimum=0, maximum=1.0, value=default_upsampling_noise, step=0.05)
gr.Markdown(CITATION)
@@ -170,70 +172,70 @@ def create_demo(model):
gr.Markdown("# Task Examples")
text_dense_prediction_tasks = gr.Textbox(label="Task", visible=False)
dense_prediction_tasks = gr.Dataset(
- samples=demo_tasks.dense_prediction_text,
+ samples=examples.dense_prediction_text,
label='Dense Prediction',
samples_per_page=1000,
components=[text_dense_prediction_tasks])
text_conditional_generation_tasks = gr.Textbox(label="Task", visible=False)
conditional_generation_tasks = gr.Dataset(
- samples=demo_tasks.conditional_generation_text,
+ samples=examples.conditional_generation_text,
label='Conditional Generation',
samples_per_page=1000,
components=[text_conditional_generation_tasks])
text_image_restoration_tasks = gr.Textbox(label="Task", visible=False)
image_restoration_tasks = gr.Dataset(
- samples=demo_tasks.image_restoration_text,
+ samples=examples.image_restoration_text,
label='Image Restoration',
samples_per_page=1000,
components=[text_image_restoration_tasks])
text_style_transfer_tasks = gr.Textbox(label="Task", visible=False)
style_transfer_tasks = gr.Dataset(
- samples=demo_tasks.style_transfer_text,
+ samples=examples.style_transfer_text,
label='Style Transfer',
samples_per_page=1000,
components=[text_style_transfer_tasks])
text_style_condition_fusion_tasks = gr.Textbox(label="Task", visible=False)
style_condition_fusion_tasks = gr.Dataset(
- samples=demo_tasks.style_condition_fusion_text,
+ samples=examples.style_condition_fusion_text,
label='Style Condition Fusion',
samples_per_page=1000,
components=[text_style_condition_fusion_tasks])
text_tryon_tasks = gr.Textbox(label="Task", visible=False)
tryon_tasks = gr.Dataset(
- samples=demo_tasks.tryon_text,
+ samples=examples.tryon_text,
label='Virtual Try-On',
samples_per_page=1000,
components=[text_tryon_tasks])
text_relighting_tasks = gr.Textbox(label="Task", visible=False)
relighting_tasks = gr.Dataset(
- samples=demo_tasks.relighting_text,
+ samples=examples.relighting_text,
label='Relighting',
samples_per_page=1000,
components=[text_relighting_tasks])
text_photodoodle_tasks = gr.Textbox(label="Task", visible=False)
photodoodle_tasks = gr.Dataset(
- samples=demo_tasks.photodoodle_text,
+ samples=examples.photodoodle_text,
label='Photodoodle',
samples_per_page=1000,
components=[text_photodoodle_tasks])
text_editing_tasks = gr.Textbox(label="Task", visible=False)
editing_tasks = gr.Dataset(
- samples=demo_tasks.editing_text,
+ samples=examples.editing_text,
label='Editing',
samples_per_page=1000,
components=[text_editing_tasks])
text_unseen_tasks = gr.Textbox(label="Task", visible=False)
unseen_tasks = gr.Dataset(
- samples=demo_tasks.unseen_tasks_text,
+ samples=examples.unseen_tasks_text,
label='Unseen Tasks (May produce unstable effects)',
samples_per_page=1000,
components=[text_unseen_tasks])
@@ -241,42 +243,42 @@ def create_demo(model):
gr.Markdown("# Subject-driven Tasks Examples")
text_subject_driven_tasks = gr.Textbox(label="Task", visible=False)
subject_driven_tasks = gr.Dataset(
- samples=demo_tasks.subject_driven_text,
+ samples=examples.subject_driven_text,
label='Subject-driven Generation',
samples_per_page=1000,
components=[text_subject_driven_tasks])
text_condition_subject_fusion_tasks = gr.Textbox(label="Task", visible=False)
condition_subject_fusion_tasks = gr.Dataset(
- samples=demo_tasks.condition_subject_fusion_text,
+ samples=examples.condition_subject_fusion_text,
label='Condition+Subject Fusion',
samples_per_page=1000,
components=[text_condition_subject_fusion_tasks])
text_style_transfer_with_subject_tasks = gr.Textbox(label="Task", visible=False)
style_transfer_with_subject_tasks = gr.Dataset(
- samples=demo_tasks.style_transfer_with_subject_text,
+ samples=examples.style_transfer_with_subject_text,
label='Style Transfer with Subject',
samples_per_page=1000,
components=[text_style_transfer_with_subject_tasks])
text_condition_subject_style_fusion_tasks = gr.Textbox(label="Task", visible=False)
condition_subject_style_fusion_tasks = gr.Dataset(
- samples=demo_tasks.condition_subject_style_fusion_text,
+ samples=examples.condition_subject_style_fusion_text,
label='Condition+Subject+Style Fusion',
samples_per_page=1000,
components=[text_condition_subject_style_fusion_tasks])
text_editing_with_subject_tasks = gr.Textbox(label="Task", visible=False)
editing_with_subject_tasks = gr.Dataset(
- samples=demo_tasks.editing_with_subject_text,
+ samples=examples.editing_with_subject_text,
label='Editing with Subject',
samples_per_page=1000,
components=[text_editing_with_subject_tasks])
text_image_restoration_with_subject_tasks = gr.Textbox(label="Task", visible=False)
image_restoration_with_subject_tasks = gr.Dataset(
- samples=demo_tasks.image_restoration_with_subject_text,
+ samples=examples.image_restoration_with_subject_text,
label='Image Restoration with Subject',
samples_per_page=1000,
components=[text_image_restoration_with_subject_tasks])
@@ -318,7 +320,6 @@ def create_demo(model):
def generate_image(*inputs):
images = []
if grid_h.value + 1 != model.grid_h or grid_w.value != model.grid_w:
- print(grid_h.value, grid_w.value, model.grid_h, model.grid_w, type(grid_h.value), type(model.grid_h))
raise gr.Error('Please wait for the loading to complete.')
for i in range(model.grid_h):
images.append([])
@@ -337,7 +338,7 @@ def create_demo(model):
upsampling_steps=upsampling_steps, upsampling_noise=upsampling_noise
)
except Exception as e:
- raise gr.Error('Process error. Possible that the task examples have not finished loading yet. Error: ' + str(e))
+ raise gr.Error('Process error. Possible that the task examples have not finished loading yet. Error: ' + e)
output = gr.update(
elem_id='output_gallery',
@@ -375,104 +376,104 @@ def create_demo(model):
update_grid(cur_hrid_h, cur_hrid_w)
output = gr.update(
elem_id='output_gallery',
- value=output,
- columns=min(len(output), 2),
- rows=int(len(output) / 2 + 0.5))
+ value=[o for o, m in zip(output, mask) if m == 1],
+ columns=min(sum(mask), 2),
+ rows=int(sum(mask) / 2 + 0.5))
return [output] + current_example + state
dense_prediction_tasks.click(
- partial(process_tasks, func=demo_tasks.process_dense_prediction_tasks),
+ partial(process_tasks, func=examples.process_dense_prediction_tasks),
inputs=[dense_prediction_tasks],
outputs=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps],
show_progress="full",
show_progress_on=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps] + [generate_btn])
conditional_generation_tasks.click(
- partial(process_tasks, func=demo_tasks.process_conditional_generation_tasks),
+ partial(process_tasks, func=examples.process_conditional_generation_tasks),
inputs=[conditional_generation_tasks],
outputs=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps],
show_progress="full")
image_restoration_tasks.click(
- partial(process_tasks, func=demo_tasks.process_image_restoration_tasks),
+ partial(process_tasks, func=examples.process_image_restoration_tasks),
inputs=[image_restoration_tasks],
outputs=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps],
show_progress="full")
style_transfer_tasks.click(
- partial(process_tasks, func=demo_tasks.process_style_transfer_tasks),
+ partial(process_tasks, func=examples.process_style_transfer_tasks),
inputs=[style_transfer_tasks],
outputs=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps],
show_progress="full")
style_condition_fusion_tasks.click(
- partial(process_tasks, func=demo_tasks.process_style_condition_fusion_tasks),
+ partial(process_tasks, func=examples.process_style_condition_fusion_tasks),
inputs=[style_condition_fusion_tasks],
outputs=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps],
show_progress="full")
relighting_tasks.click(
- partial(process_tasks, func=demo_tasks.process_relighting_tasks),
+ partial(process_tasks, func=examples.process_relighting_tasks),
inputs=[relighting_tasks],
outputs=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps],
show_progress="full")
tryon_tasks.click(
- partial(process_tasks, func=demo_tasks.process_tryon_tasks),
+ partial(process_tasks, func=examples.process_tryon_tasks),
inputs=[tryon_tasks],
outputs=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps],
show_progress="full")
photodoodle_tasks.click(
- partial(process_tasks, func=demo_tasks.process_photodoodle_tasks),
+ partial(process_tasks, func=examples.process_photodoodle_tasks),
inputs=[photodoodle_tasks],
outputs=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps],
show_progress="full")
editing_tasks.click(
- partial(process_tasks, func=demo_tasks.process_editing_tasks),
+ partial(process_tasks, func=examples.process_editing_tasks),
inputs=[editing_tasks],
outputs=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps],
show_progress="full")
unseen_tasks.click(
- partial(process_tasks, func=demo_tasks.process_unseen_tasks),
+ partial(process_tasks, func=examples.process_unseen_tasks),
inputs=[unseen_tasks],
outputs=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps],
show_progress="full")
subject_driven_tasks.click(
- partial(process_tasks, func=demo_tasks.process_subject_driven_tasks),
+ partial(process_tasks, func=examples.process_subject_driven_tasks),
inputs=[subject_driven_tasks],
outputs=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps],
show_progress="full")
style_transfer_with_subject_tasks.click(
- partial(process_tasks, func=demo_tasks.process_style_transfer_with_subject_tasks),
+ partial(process_tasks, func=examples.process_style_transfer_with_subject_tasks),
inputs=[style_transfer_with_subject_tasks],
outputs=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps],
show_progress="full")
condition_subject_fusion_tasks.click(
- partial(process_tasks, func=demo_tasks.process_condition_subject_fusion_tasks),
+ partial(process_tasks, func=examples.process_condition_subject_fusion_tasks),
inputs=[condition_subject_fusion_tasks],
outputs=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps],
show_progress="full")
condition_subject_style_fusion_tasks.click(
- partial(process_tasks, func=demo_tasks.process_condition_subject_style_fusion_tasks),
+ partial(process_tasks, func=examples.process_condition_subject_style_fusion_tasks),
inputs=[condition_subject_style_fusion_tasks],
outputs=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps],
show_progress="full")
editing_with_subject_tasks.click(
- partial(process_tasks, func=demo_tasks.process_editing_with_subject_tasks),
+ partial(process_tasks, func=examples.process_editing_with_subject_tasks),
inputs=[editing_with_subject_tasks],
outputs=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps],
show_progress="full")
image_restoration_with_subject_tasks.click(
- partial(process_tasks, func=demo_tasks.process_image_restoration_with_subject_tasks),
+ partial(process_tasks, func=examples.process_image_restoration_with_subject_tasks),
inputs=[image_restoration_with_subject_tasks],
outputs=[output_gallery] + all_image_inputs + [grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps],
show_progress="full")
@@ -496,7 +497,7 @@ def create_demo(model):
# @spaces.GPU(duration=120)
-@spaces.GPU(duration=10)
+# @spaces.GPU(duration=10)
def generate(
images,
prompts,
@@ -514,7 +515,7 @@ def generate(
def parse_args():
parser = argparse.ArgumentParser()
- parser.add_argument("--model_path", type=str, default="models/visualcloze-384-lora.pth")
+ parser.add_argument("--model_path", type=str, default="checkpoints/visualcloze-384-lora.pth")
parser.add_argument("--precision", type=str, choices=["fp32", "bf16", "fp16"], default="bf16")
parser.add_argument("--resolution", type=int, default=384)
return parser.parse_args()
@@ -523,7 +524,7 @@ def parse_args():
if __name__ == "__main__":
args = parse_args()
- # snapshot_download(repo_id="VisualCloze/VisualCloze", repo_type="model", local_dir="models")
+ # snapshot_download(repo_id="VisualCloze/VisualCloze", repo_type="model", local_dir="checkpoints")
# Initialize model
model = VisualClozeModel(resolution=args.resolution, model_path=args.model_path, precision=args.precision)
@@ -532,5 +533,5 @@ if __name__ == "__main__":
demo = create_demo(model)
# Start Gradio server
- demo.launch()
- # demo.launch(share=False, server_port=10050, server_name="0.0.0.0")
\ No newline at end of file
+ # demo.launch()
+ demo.launch(share=False, server_port=10050, server_name="0.0.0.0")
\ No newline at end of file
diff --git a/data/degradation_toolkit/__init__.py b/data/degradation_toolkit/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/data/degradation_toolkit/add_degradation_various.py b/data/degradation_toolkit/add_degradation_various.py
new file mode 100644
index 0000000000000000000000000000000000000000..4e16fb38f02d84358e6f74903b837da75b98d31e
--- /dev/null
+++ b/data/degradation_toolkit/add_degradation_various.py
@@ -0,0 +1,401 @@
+import os
+import numpy as np
+import random
+import cv2
+import math
+from scipy import special
+from skimage import restoration
+
+import torch
+from torch.nn import functional as F
+from torchvision.utils import make_grid
+
+
+def uint2single(img):
+ return np.float32(img/255.)
+
+
+def single2uint(img):
+ return np.uint8((img.clip(0, 1)*255.).round())
+
+
+def img2tensor(imgs, bgr2rgb=True, float32=True):
+ """Numpy array to tensor.
+ Args:
+ imgs (list[ndarray] | ndarray): Input images.
+ bgr2rgb (bool): Whether to change bgr to rgb.
+ float32 (bool): Whether to change to float32.
+ Returns:
+ list[tensor] | tensor: Tensor images. If returned results only have
+ one element, just return tensor.
+ """
+
+ def _totensor(img, bgr2rgb, float32):
+ if img.shape[2] == 3 and bgr2rgb:
+ if img.dtype == 'float64':
+ img = img.astype('float32')
+ img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
+ img = torch.from_numpy(img.transpose(2, 0, 1))
+ if float32:
+ img = img.float()
+ return img
+
+ if isinstance(imgs, list):
+ return [_totensor(img, bgr2rgb, float32) for img in imgs]
+ else:
+ return _totensor(imgs, bgr2rgb, float32)
+
+
+def tensor2img(tensor, rgb2bgr=True, out_type=np.uint8, min_max=(0, 1)):
+ """Convert torch Tensors into image numpy arrays.
+ After clamping to [min, max], values will be normalized to [0, 1].
+ Args:
+ tensor (Tensor or list[Tensor]): Accept shapes:
+ 1) 4D mini-batch Tensor of shape (B x 3/1 x H x W);
+ 2) 3D Tensor of shape (3/1 x H x W);
+ 3) 2D Tensor of shape (H x W).
+ Tensor channel should be in RGB order.
+ rgb2bgr (bool): Whether to change rgb to bgr.
+ out_type (numpy type): output types. If ``np.uint8``, transform outputs
+ to uint8 type with range [0, 255]; otherwise, float type with
+ range [0, 1]. Default: ``np.uint8``.
+ min_max (tuple[int]): min and max values for clamp.
+ Returns:
+ (Tensor or list): 3D ndarray of shape (H x W x C) OR 2D ndarray of
+ shape (H x W). The channel order is BGR.
+ """
+ if not (torch.is_tensor(tensor) or (isinstance(tensor, list) and all(torch.is_tensor(t) for t in tensor))):
+ raise TypeError(f'tensor or list of tensors expected, got {type(tensor)}')
+
+ if torch.is_tensor(tensor):
+ tensor = [tensor]
+ result = []
+ for _tensor in tensor:
+ _tensor = _tensor.squeeze(0).float().detach().cpu().clamp_(*min_max)
+ _tensor = (_tensor - min_max[0]) / (min_max[1] - min_max[0])
+
+ n_dim = _tensor.dim()
+ if n_dim == 4:
+ img_np = make_grid(_tensor, nrow=int(math.sqrt(_tensor.size(0))), normalize=False).numpy()
+ img_np = img_np.transpose(1, 2, 0)
+ if rgb2bgr:
+ img_np = cv2.cvtColor(img_np, cv2.COLOR_RGB2BGR)
+ elif n_dim == 3:
+ img_np = _tensor.numpy()
+ img_np = img_np.transpose(1, 2, 0)
+ if img_np.shape[2] == 1: # gray image
+ img_np = np.squeeze(img_np, axis=2)
+ else:
+ if rgb2bgr:
+ img_np = cv2.cvtColor(img_np, cv2.COLOR_RGB2BGR)
+ elif n_dim == 2:
+ img_np = _tensor.numpy()
+ else:
+ raise TypeError(f'Only support 4D, 3D or 2D tensor. But received with dimension: {n_dim}')
+ if out_type == np.uint8:
+ # Unlike MATLAB, numpy.unit8() WILL NOT round by default.
+ img_np = (img_np * 255.0).round()
+ img_np = img_np.astype(out_type)
+ result.append(img_np)
+ if len(result) == 1:
+ result = result[0]
+ return result
+
+
+def get_noise(img, value=10):
+
+ noise = np.random.uniform(0, 256, img.shape[0:2])
+
+ v = value * 0.01
+ noise[np.where(noise < (256 - v))] = 0
+
+ k = np.array([[0, 0.1, 0],
+ [0.1, 8, 0.1],
+ [0, 0.1, 0]])
+
+ noise = cv2.filter2D(noise, -1, k)
+
+ '''cv2.imshow('img',noise)
+ cv2.waitKey()
+ cv2.destroyWindow('img')'''
+ return noise
+
+
+def rain_blur(noise, length=10, angle=0, w=1):
+
+ trans = cv2.getRotationMatrix2D((length / 2, length / 2), angle - 45, 1 - length / 100.0)
+ dig = np.diag(np.ones(length))
+ k = cv2.warpAffine(dig, trans, (length, length))
+ k = cv2.GaussianBlur(k, (w, w), 0)
+
+ blurred = cv2.filter2D(noise, -1, k)
+
+ cv2.normalize(blurred, blurred, 0, 255, cv2.NORM_MINMAX)
+ blurred = np.array(blurred, dtype=np.uint8)
+
+ rain = np.expand_dims(blurred, 2)
+ blurred = np.repeat(rain, 3, 2)
+
+ return blurred
+
+
+def add_rain(img,value):
+ if np.max(img) > 1:
+ pass
+ else:
+ img = img*255
+
+
+ w, h, c = img.shape
+ h = h - (h % 4)
+ w = w - (w % 4)
+ img = img[0:w, 0:h, :]
+
+
+ w = np.random.choice([3, 5, 7, 9, 11], p=[0.2, 0.2, 0.2, 0.2, 0.2])
+ length = np.random.randint(30, 41)
+ angle = np.random.randint(-45, 45)
+
+ noise = get_noise(img, value=value)
+ rain = rain_blur(noise, length=length, angle=angle, w=w)
+
+ img = img.astype('float32') + rain
+ np.clip(img, 0, 255, out=img)
+ img = img/255.0
+ return img
+
+
+def add_rain_range(img, value_min, value_max):
+ value = np.random.randint(value_min, value_max)
+ if np.max(img) > 1:
+ pass
+ else:
+ img = img*255
+
+
+ w, h, c = img.shape
+ h = h - (h % 4)
+ w = w - (w % 4)
+ img = img[0:w, 0:h, :]
+
+
+ w = np.random.choice([3, 5, 7, 9, 11], p=[0.2, 0.2, 0.2, 0.2, 0.2])
+ length = np.random.randint(30, 41)
+ angle = np.random.randint(-45, 45)
+
+ noise = get_noise(img, value=value)
+ rain = rain_blur(noise, length=length, angle=angle, w=w)
+
+ img = img.astype('float32') + rain
+ np.clip(img, 0, 255, out=img)
+ img = img/255.0
+ return img
+
+
+def add_Poisson_noise(img, level=2):
+ # input range[0, 1]
+ vals = 10**(level)
+ img = np.random.poisson(img * vals).astype(np.float32) / vals
+ img = np.clip(img, 0.0, 1.0)
+ return img
+
+
+def add_Gaussian_noise(img, level=20):
+ # input range[0, 1]
+ noise_level = level / 255.0
+ noise_map = np.random.normal(loc=0.0, scale=1.0, size=img.shape)*noise_level
+ img += noise_map
+ img = np.clip(img, 0.0, 1.0)
+ return img
+
+
+def add_Gaussian_noise_range(img, min_level=10, max_level=50):
+ # input range[0, 1]
+ level = random.uniform(min_level, max_level)
+ noise_level = level / 255.0
+ noise_map = np.random.normal(loc=0.0, scale=1.0, size=img.shape)*noise_level
+ img += noise_map
+ img = np.clip(img, 0.0, 1.0)
+ return img
+
+
+def add_sp_noise(img, snr=0.95, salt_pro=0.5):
+ # input range[0, 1]
+ output = np.copy(img)
+ for i in range(img.shape[0]):
+ for j in range(img.shape[1]):
+ rdn = random.random()
+ if rdn < snr:
+ output[i][j] = img[i][j]
+ else:
+ rdn = random.random()
+ if rdn < salt_pro:
+ output[i][j] = 1
+ else:
+ output[i][j] = 0
+
+ return output
+
+
+def add_JPEG_noise(img, level):
+
+ quality_factor = level
+ img = single2uint(img)
+ _, encimg = cv2.imencode('.jpg', img, [int(cv2.IMWRITE_JPEG_QUALITY), quality_factor])
+ img = cv2.imdecode(encimg, 1)
+ img = uint2single(img)
+
+ return img
+
+
+def add_JPEG_noise_range(img, level_min, level_max):
+
+ quality_factor = random.randint(level_min, level_max)
+ img = single2uint(img)
+ _, encimg = cv2.imencode('.jpg', img, [int(cv2.IMWRITE_JPEG_QUALITY), quality_factor])
+ img = cv2.imdecode(encimg, 1)
+ img = uint2single(img)
+
+ return img
+
+
+def circular_lowpass_kernel(cutoff, kernel_size, pad_to=0):
+ """2D sinc filter, ref: https://dsp.stackexchange.com/questions/58301/2-d-circularly-symmetric-low-pass-filter
+
+ Args:
+ cutoff (float): cutoff frequency in radians (pi is max)
+ kernel_size (int): horizontal and vertical size, must be odd.
+ pad_to (int): pad kernel size to desired size, must be odd or zero.
+ """
+ assert kernel_size % 2 == 1, 'Kernel size must be an odd number.'
+ kernel = np.fromfunction(
+ lambda x, y: cutoff * special.j1(cutoff * np.sqrt(
+ (x - (kernel_size - 1) / 2) ** 2 + (y - (kernel_size - 1) / 2) ** 2)) / ((2 * np.pi * np.sqrt(
+ (x - (kernel_size - 1) / 2) ** 2 + (y - (kernel_size - 1) / 2) ** 2)) + 1e-9), [kernel_size, kernel_size])
+ kernel[(kernel_size - 1) // 2, (kernel_size - 1) // 2] = cutoff ** 2 / (4 * np.pi)
+ kernel = kernel / np.sum(kernel)
+ if pad_to > kernel_size:
+ pad_size = (pad_to - kernel_size) // 2
+ kernel = np.pad(kernel, ((pad_size, pad_size), (pad_size, pad_size)))
+ return kernel
+
+
+def filter2D(img, kernel):
+ """PyTorch version of cv2.filter2D
+ Args:
+ img (Tensor): (b, c, h, w)
+ kernel (Tensor): (b, k, k)
+ """
+ k = kernel.size(-1)
+ b, c, h, w = img.size()
+ if k % 2 == 1:
+ img = F.pad(img, (k // 2, k // 2, k // 2, k // 2), mode='reflect')
+ else:
+ raise ValueError('Wrong kernel size')
+
+ ph, pw = img.size()[-2:]
+
+ if kernel.size(0) == 1:
+ # apply the same kernel to all batch images
+ img = img.view(b * c, 1, ph, pw)
+ kernel = kernel.view(1, 1, k, k)
+ return F.conv2d(img, kernel, padding=0).view(b, c, h, w)
+ else:
+ img = img.view(1, b * c, ph, pw)
+ kernel = kernel.view(b, 1, k, k).repeat(1, c, 1, 1).view(b * c, 1, k, k)
+ return F.conv2d(img, kernel, groups=b * c).view(b, c, h, w)
+
+
+def sinc(img, kernel_size,omega_c):
+
+ sinc_kernel = circular_lowpass_kernel(omega_c, kernel_size, pad_to=21)
+ sinc_kernel = torch.FloatTensor(sinc_kernel)
+
+ img = filter2D(img,sinc_kernel)
+
+ return img
+
+
+def add_ringing(img):
+ # input: [0, 1]
+ img = img2tensor([img])[0].unsqueeze(0)
+ ks = 15
+ omega_c = round(1.2, 2)
+ img = sinc(img, ks, omega_c)
+ img = torch.clamp((img * 255.0).round(), 0, 255) / 255.
+ img = tensor2img(img, min_max=(0, 1))
+ img = img/255.0
+ return img
+
+
+def low_light(img, lum_scale):
+ img = img*lum_scale
+ return img
+
+
+def low_light_range(img):
+ lum_scale = random.uniform(0.1, 0.5)
+ img = img*lum_scale
+ return img
+
+
+def iso_GaussianBlur(img, window, sigma):
+ img = cv2.GaussianBlur(img.copy(), (window, window), sigma)
+ return img
+
+
+def iso_GaussianBlur_range(img, window, min_sigma=2, max_sigma=4):
+ sigma = random.uniform(min_sigma, max_sigma)
+ img = cv2.GaussianBlur(img.copy(), (window, window), sigma)
+ return img
+
+
+def add_resize(img):
+ ori_H, ori_W = img.shape[0], img.shape[1]
+ rnum = np.random.rand()
+ if rnum > 0.8: # up
+ sf1 = random.uniform(1, 2)
+ elif rnum < 0.7: # down
+ sf1 = random.uniform(0.2, 1)
+ else:
+ sf1 = 1.0
+ img = cv2.resize(img, (int(sf1*img.shape[1]), int(sf1*img.shape[0])), interpolation=random.choice([1, 2, 3]))
+ img = cv2.resize(img, (int(ori_W), int(ori_H)), interpolation=random.choice([1, 2, 3]))
+
+ img = np.clip(img, 0.0, 1.0)
+
+ return img
+
+
+def r_l(img):
+ img = img2tensor([img],bgr2rgb=False)[0].unsqueeze(0)
+ psf = np.ones((1, 1, 5, 5))
+ psf = psf / psf.sum()
+ img = img.numpy()
+ img = np.pad(img, ((0, 0), (0, 0), (7, 7), (7, 7)), 'linear_ramp')
+ img = restoration.richardson_lucy(img, psf, 1)
+ img = img[:, :, 7:-7, 7:-7]
+ img = torch.from_numpy(img)
+ img = img.squeeze(0).numpy().transpose(1, 2, 0)
+ return img
+
+
+def inpainting(img,l_num,l_thick):
+
+ ori_h, ori_w = img.shape[0], img.shape[1]
+ mask = np.zeros((ori_h, ori_w, 3), np.uint8)
+ col = random.choice(['white', 'black'])
+ while (l_num):
+ x1, y1 = random.randint(0, ori_w), random.randint(0, ori_h)
+ x2, y2 = random.randint(0, ori_w), random.randint(0, ori_h)
+ pts = np.array([[x1, y1], [x2, y2]], np.int32)
+ pts = pts.reshape((-1, 1, 2))
+ mask = cv2.polylines(mask, [pts], 0, (1, 1, 1), l_thick)
+ l_num -= 1
+
+ if col == 'white':
+ img = np.clip(img + mask, 0, 1)
+ else:
+ img = np.clip(img - mask, 0, 1)
+
+ return img
diff --git a/data/degradation_toolkit/degradation_utils.py b/data/degradation_toolkit/degradation_utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..28c8f72e7fdeeccd8995132366d30f8f88a5fee2
--- /dev/null
+++ b/data/degradation_toolkit/degradation_utils.py
@@ -0,0 +1,232 @@
+import numpy as np
+import cv2
+import random
+from PIL import Image
+
+from data.degradation_toolkit.add_degradation_various import *
+from data.degradation_toolkit.image_operators import *
+from data.degradation_toolkit.x_distortion import *
+
+
+degradation_list1 = [
+ 'blur',
+ 'noise',
+ 'compression',
+ 'brighten',
+ 'darken',
+ 'spatter',
+ 'contrast_strengthen',
+ 'contrast_weaken',
+ 'saturate_strengthen',
+ 'saturate_weaken',
+ 'oversharpen',
+ 'pixelate',
+ 'quantization',
+]
+
+
+degradation_list2 = [
+ 'Rain',
+ 'Ringing',
+ 'r_l',
+ 'Inpainting',
+ 'mosaic',
+ 'SRx2',
+ 'SRx4',
+ 'GaussianNoise',
+ 'GaussianBlur',
+ 'JPEG',
+ 'Resize',
+ 'SPNoise',
+ 'LowLight',
+ 'PoissonNoise',
+ 'gray',
+ 'ColorDistortion',
+]
+
+
+degradation_list3 = [
+ 'Laplacian',
+ 'Canny',
+ 'Sobel',
+ 'Defocus',
+ 'Mosaic',
+ 'Barrel',
+ 'Pincushion',
+ 'Spatter',
+ 'Elastic',
+ 'Frost',
+ 'Contrast',
+]
+
+
+degradation_list4 = [
+ 'flip',
+ 'rotate90',
+ 'rotate180',
+ 'rotate270',
+ 'identity',
+]
+
+
+all_degradation_types = degradation_list1 + degradation_list2 + degradation_list3 + degradation_list4
+
+
+def single2uint(img):
+ return np.uint8((img.clip(0, 1) * 255.0).round())
+
+
+def uint2single(img):
+ return np.float32(img / 255.0)
+
+
+def add_x_distortion_single_images(img_gt1, deg_type):
+ # np.uint8, BGR
+ x_distortion_dict = distortions_dict
+ severity = random.choice([1, 2, 3, 4, 5])
+ if deg_type == 'compression' or deg_type == "quantization":
+ severity = min(3, severity)
+ deg_type = random.choice(x_distortion_dict[deg_type])
+
+ img_gt1 = cv2.cvtColor(img_gt1, cv2.COLOR_BGR2RGB)
+ img_lq1 = globals()[deg_type](img_gt1, severity)
+
+ img_gt1 = cv2.cvtColor(img_gt1, cv2.COLOR_RGB2BGR)
+ img_lq1 = cv2.cvtColor(img_lq1, cv2.COLOR_RGB2BGR)
+
+ return img_lq1, img_gt1, deg_type
+
+
+def add_degradation_single_images(img_gt1, deg_type):
+ if deg_type == 'Rain':
+ value = random.uniform(40, 200)
+ img_lq1 = add_rain(img_gt1, value=value)
+ elif deg_type == 'Ringing':
+ img_lq1 = add_ringing(img_gt1)
+ elif deg_type == 'r_l':
+ img_lq1 = r_l(img_gt1)
+ elif deg_type == 'Inpainting':
+ l_num = random.randint(20, 50)
+ l_thick = random.randint(10, 20)
+ img_lq1 = inpainting(img_gt1, l_num=l_num, l_thick=l_thick)
+ elif deg_type == 'mosaic':
+ img_lq1 = mosaic_CFA_Bayer(img_gt1)
+ elif deg_type == 'SRx2':
+ H, W, _ = img_gt1.shape
+ img_lq1 = cv2.resize(img_gt1, (W//2, H//2), interpolation=cv2.INTER_CUBIC)
+ img_lq1 = cv2.resize(img_lq1, (W, H), interpolation=cv2.INTER_CUBIC)
+ elif deg_type == 'SRx4':
+ H, W, _ = img_gt1.shape
+ img_lq1 = cv2.resize(img_gt1, (W//4, H//4), interpolation=cv2.INTER_CUBIC)
+ img_lq1 = cv2.resize(img_lq1, (W, H), interpolation=cv2.INTER_CUBIC)
+
+ elif deg_type == 'GaussianNoise':
+ level = random.uniform(10, 50)
+ img_lq1 = add_Gaussian_noise(img_gt1, level=level)
+ elif deg_type == 'GaussianBlur':
+ sigma = random.uniform(2, 4)
+ img_lq1 = iso_GaussianBlur(img_gt1, window=15, sigma=sigma)
+ elif deg_type == 'JPEG':
+ level = random.randint(10, 40)
+ img_lq1 = add_JPEG_noise(img_gt1, level=level)
+ elif deg_type == 'Resize':
+ img_lq1 = add_resize(img_gt1)
+ elif deg_type == 'SPNoise':
+ img_lq1 = add_sp_noise(img_gt1)
+ elif deg_type == 'LowLight':
+ lum_scale = random.uniform(0.3, 0.4)
+ img_lq1 = low_light(img_gt1, lum_scale=lum_scale)
+ elif deg_type == 'PoissonNoise':
+ img_lq1 = add_Poisson_noise(img_gt1, level=2)
+ elif deg_type == 'gray':
+ img_lq1 = cv2.cvtColor(img_gt1, cv2.COLOR_BGR2GRAY)
+ img_lq1 = np.expand_dims(img_lq1, axis=2)
+ img_lq1 = np.concatenate((img_lq1, img_lq1, img_lq1), axis=2)
+ elif deg_type == 'None':
+ img_lq1 = img_gt1
+ elif deg_type == 'ColorDistortion':
+ if random.random() < 0.5:
+ channels = list(range(3))
+ random.shuffle(channels)
+ img_lq1 = img_gt1[..., channels]
+ else:
+ channel = random.randint(0, 2)
+ img_lq1 = img_gt1.copy()
+ if random.random() < 0.5:
+ img_lq1[..., channel] = 0
+ else:
+ img_lq1[..., channel] = 1
+ else:
+ print('Error!', '-', deg_type, '-')
+ exit()
+ img_lq1 = np.clip(img_lq1 * 255, 0, 255).round().astype(np.uint8)
+ img_lq1 = img_lq1.astype(np.float32) / 255.0
+ img_gt1 = np.clip(img_gt1 * 255, 0, 255).round().astype(np.uint8)
+ img_gt1 = img_gt1.astype(np.float32) / 255.0
+
+ return img_lq1, img_gt1
+
+
+def calculate_operators_single_images(img_gt1, deg_type):
+ img_gt1 = img_gt1.copy()
+
+ if deg_type == 'Laplacian':
+ img_lq1 = Laplacian_edge_detector(img_gt1)
+ elif deg_type == 'Canny':
+ img_lq1 = Canny_edge_detector(img_gt1)
+ elif deg_type == 'Sobel':
+ img_lq1 = Sobel_edge_detector(img_gt1)
+ elif deg_type == 'Defocus':
+ img_lq1 = defocus_blur(img_gt1, level=(3, 0.2))
+ elif deg_type == 'Mosaic':
+ img_lq1 = mosaic_CFA_Bayer(img_gt1)
+ elif deg_type == 'Barrel':
+ img_lq1 = simulate_barrel_distortion(img_gt1, k1=0.1, k2=0.05)
+ elif deg_type == 'Pincushion':
+ img_lq1 = simulate_pincushion_distortion(img_gt1, k1=-0.1, k2=-0.05)
+ elif deg_type == 'Spatter':
+ img_lq1 = uint2single(spatter((img_gt1), severity=1))
+ elif deg_type == 'Elastic':
+ img_lq1 = elastic_transform((img_gt1), severity=4)
+ elif deg_type == 'Frost':
+ img_lq1 = uint2single(frost(img_gt1, severity=4))
+ elif deg_type == 'Contrast':
+ img_lq1 = adjust_contrast(img_gt1, clip_limit=4.0, tile_grid_size=(4, 4))
+
+ if np.mean(img_lq1).astype(np.float16) == 0:
+ print(deg_type, 'prompt&query zero images.')
+ img_lq1 = img_gt1.copy()
+
+ return img_lq1, img_gt1
+
+
+def add_degradation(image, deg_type):
+ if deg_type in degradation_list1:
+ list_idx = 1
+ img_lq1, _, _ = add_x_distortion_single_images(np.copy(image), deg_type)
+ img_lq1 = uint2single(img_lq1)
+ elif deg_type in degradation_list2:
+ list_idx = 2
+ img_lq1, _ = add_degradation_single_images(np.copy(uint2single(image)), deg_type)
+ elif deg_type in degradation_list3:
+ list_idx = 3
+ if deg_type in ['Laplacian', 'Canny', 'Sobel', 'Frost']:
+ img_lq1, _ = calculate_operators_single_images(np.copy(image), deg_type)
+ else:
+ img_lq1, _ = calculate_operators_single_images(np.copy(uint2single(image)), deg_type)
+ if img_lq1.max() > 1:
+ img_lq1 = uint2single(img_lq1)
+ elif deg_type in degradation_list4:
+ list_idx = 4
+ img_lq1 = np.copy(uint2single(image))
+ if deg_type == 'flip':
+ img_lq1 = np.flip(img_lq1, axis=1)
+ elif deg_type == 'rotate90':
+ img_lq1 = np.rot90(img_lq1, k=1)
+ elif deg_type == 'rotate180':
+ img_lq1 = np.rot90(img_lq1, k=2)
+ elif deg_type == 'rotate270':
+ img_lq1 = np.rot90(img_lq1, k=3)
+ elif deg_type == 'identity':
+ pass
+ return Image.fromarray(single2uint(img_lq1)), list_idx
diff --git a/data/degradation_toolkit/frost/frost1.png b/data/degradation_toolkit/frost/frost1.png
new file mode 100644
index 0000000000000000000000000000000000000000..c9edf9b6e1a2744d15af615af641f2aa48aa89c2
--- /dev/null
+++ b/data/degradation_toolkit/frost/frost1.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ff9f907860bd7a835d459e32f9d588062b7f61ee267343cc7222b56753a14755
+size 1199930
diff --git a/data/degradation_toolkit/frost/frost2.png b/data/degradation_toolkit/frost/frost2.png
new file mode 100644
index 0000000000000000000000000000000000000000..473ea3de89283621191b98205f7fb6b0b10ba72b
--- /dev/null
+++ b/data/degradation_toolkit/frost/frost2.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fe211a89b336999c207a852ce05818d4545d0b57c5beadd824b4cc9d9a9b6137
+size 299002
diff --git a/data/degradation_toolkit/frost/frost3.png b/data/degradation_toolkit/frost/frost3.png
new file mode 100644
index 0000000000000000000000000000000000000000..c898fc267e33dd03d40bbf7d72d21e78485918d0
--- /dev/null
+++ b/data/degradation_toolkit/frost/frost3.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2d0d50b4a9bb213f38b024ef7768731bb83cc08d2f26b5766bbc167cdfa0e504
+size 299002
diff --git a/data/degradation_toolkit/frost/frost4.jpg b/data/degradation_toolkit/frost/frost4.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..154cf6e0c6b3dae3cd3fbad8388658df047786b8
--- /dev/null
+++ b/data/degradation_toolkit/frost/frost4.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3f8b91ca1a9fa7167b09e773da53f5ae60d0a1fd88f02a783f6e328a72887f6e
+size 36734
diff --git a/data/degradation_toolkit/frost/frost5.jpg b/data/degradation_toolkit/frost/frost5.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..350091fd0e9cd3f048e543c0aaf9aeb57f1a4beb
--- /dev/null
+++ b/data/degradation_toolkit/frost/frost5.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5fc6a19df4a429ba68abdcc8f8a4278d4c9f81c9ccafd2c92ab0c8cf8992ebd2
+size 155150
diff --git a/data/degradation_toolkit/frost/frost6.jpg b/data/degradation_toolkit/frost/frost6.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..8df587c3f321d7df886ab40ab4c577de8b8aac52
--- /dev/null
+++ b/data/degradation_toolkit/frost/frost6.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1f92b2f48408748085b68dd81d816ef239f42cef3029c25d041fcb6760fb4f25
+size 90185
diff --git a/data/degradation_toolkit/image_operators.py b/data/degradation_toolkit/image_operators.py
new file mode 100644
index 0000000000000000000000000000000000000000..878b2c4ca5c3e399c8475f88d5c152486642bb56
--- /dev/null
+++ b/data/degradation_toolkit/image_operators.py
@@ -0,0 +1,420 @@
+import os
+import cv2
+import numpy as np
+import argparse
+from skimage.filters import gaussian
+from scipy.ndimage.interpolation import map_coordinates
+from tqdm import tqdm
+from PIL import Image
+
+
+def single2uint(img):
+ return np.uint8((img.clip(0, 1)*255.).round())
+
+
+def uint2single(img):
+ return np.float32(img/255.)
+
+
+def Laplacian_edge_detector(img):
+ # input: [0, 1]
+ # return: [0, 1] (H, W, 3)
+ img = np.clip(img*255, 0, 255).astype(np.uint8) # (H, W, 3)
+ img = cv2.GaussianBlur(img, (3, 3), 0)
+ img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
+ img = cv2.Laplacian(img, cv2.CV_16S) # (H, W)
+ img = cv2.convertScaleAbs(img)
+ img = img.astype(np.float32) / 255.
+ img = np.expand_dims(img, 2).repeat(3, axis=2) # (H, W, 3)
+ return img
+
+
+def Laplacian_edge_detector_uint8(img):
+ # input: [0, 255]
+ # return: [0, 255] (H, W, 3)
+ img = cv2.GaussianBlur(img, (3, 3), 0)
+ img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
+ img = cv2.Laplacian(img, cv2.CV_16S) # (H, W)
+ img = cv2.convertScaleAbs(img)
+ img = np.expand_dims(img, 2).repeat(3, axis=2) # (H, W, 3)
+ return img
+
+
+def Canny_edge_detector(img):
+ # input: [0, 1]
+ # return: [0, 1] (H, W, 3)
+ img = np.clip(img*255, 0, 255).astype(np.uint8) # (H, W, 3)
+ img = cv2.GaussianBlur(img, (3, 3), 0)
+ img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
+ img = cv2.Canny(img, 50, 200) # (H, W)
+ img = cv2.convertScaleAbs(img)
+ img = img.astype(np.float32) / 255.
+ img = np.expand_dims(img, 2).repeat(3, axis=2) # (H, W, 3)
+ return img
+
+
+def Canny_edge_detector_uint8(img):
+ # input: [0, 255]
+ # return: [0, 255] (H, W, 3)
+ img = cv2.GaussianBlur(img, (3, 3), 0)
+ img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
+ img = cv2.Canny(img, 50, 200) # (H, W)
+ img = cv2.convertScaleAbs(img)
+ img = np.expand_dims(img, 2).repeat(3, axis=2) # (H, W, 3)
+ return img
+
+
+def Sobel_edge_detector(img):
+ # input: [0, 1]
+ # return: [0, 1] (H, W, 3)
+ img = np.clip(img*255, 0, 255).astype(np.uint8) # (H, W, 3)
+ img = cv2.GaussianBlur(img, (3, 3), 0)
+ img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
+ img = cv2.Sobel(img, cv2.CV_16S, 1, 1) # (H, W)
+ img = cv2.convertScaleAbs(img)
+ img = img.astype(np.float32) / 255.
+ img = np.expand_dims(img, 2).repeat(3, axis=2) # (H, W, 3)
+ return img
+
+
+def erosion(img, kernel_size=5):
+ kernel = np.ones((kernel_size, kernel_size), np.uint8)
+ img = cv2.erode(img, kernel, iterations=1)
+ return img
+
+
+def dilatation(img, kernel_size=5):
+ kernel = np.ones((kernel_size, kernel_size), np.uint8)
+ img = cv2.dilate(img, kernel, iterations=1)
+ return img
+
+
+def opening(img):
+ return dilatation(erosion(img))
+
+
+def closing(img):
+ return erosion(dilatation(img))
+
+
+def morphological_gradient(img):
+ return dilatation(img) - erosion(img)
+
+
+def top_hat(img):
+ return img - opening(img)
+
+
+def black_hat(img):
+ return closing(img) - img
+
+
+def adjust_contrast(image, clip_limit=2.0, tile_grid_size=(8, 8)):
+
+ image = single2uint(image)
+ lab = cv2.cvtColor(image, cv2.COLOR_BGR2LAB)
+
+ l, a, b = cv2.split(lab)
+
+ clahe = cv2.createCLAHE(clipLimit=clip_limit, tileGridSize=tile_grid_size)
+ l_eq = clahe.apply(l)
+
+ lab_eq = cv2.merge((l_eq, a, b))
+ result = cv2.cvtColor(lab_eq, cv2.COLOR_LAB2BGR)
+
+ result = uint2single(result)
+ return result
+
+
+def embossing(img):
+ kernel = np.array([[0, -1, -1],
+ [1, 0, -1],
+ [1, 1, 0]])
+ return cv2.filter2D(img, -1, kernel)
+
+
+def hough_transform_line_detection(img):
+ img = single2uint(img)
+ dst = cv2.Canny(img, 50, 200, apertureSize=3)
+ cdst = cv2.cvtColor(dst, cv2.COLOR_GRAY2BGR)
+ lines = cv2.HoughLinesP(dst, 1, np.pi / 180, 230, None, 0, 0)
+ if lines is not None:
+ for i in range(0, len(lines)):
+ rho = lines[i][0][0]
+ theta = lines[i][0][1]
+ a = np.cos(theta)
+ b = np.sin(theta)
+
+ x0 = a * rho
+ y0 = b * rho
+ pt1 = (int(x0 + 1000*(-b)), int(y0 + 1000*(a)))
+
+ pt2 = (int(x0 - 1000*(-b)), int(y0 - 1000*(a)))
+ cv2.line(img, pt1, pt2, (0, 0, 255), 3, cv2.LINE_AA)
+
+ return uint2single(img)
+
+
+def hough_circle_detection(img):
+ gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
+ circles = cv2.HoughCircles(gray, cv2.HOUGH_GRADIENT, 1, 100, param1=100, param2=30, minRadius=50, maxRadius=200)
+ circles = np.uint16(np.around(circles))
+ for i in circles[0, :]:
+ cv2.circle(img, (i[0], i[1]), i[2], (0, 0, 255), 2)
+ return img
+
+
+def disk(radius, alias_blur=0.1, dtype=np.float32):
+ if radius <= 8:
+ L = np.arange(-8, 8 + 1)
+ ksize = (3, 3)
+ else:
+ L = np.arange(-radius, radius + 1)
+ ksize = (5, 5)
+ X, Y = np.meshgrid(L, L)
+ aliased_disk = np.array((X ** 2 + Y ** 2) <= radius ** 2, dtype=dtype)
+ aliased_disk /= np.sum(aliased_disk)
+
+ # supersample disk to antialias
+ return cv2.GaussianBlur(aliased_disk, ksize=ksize, sigmaX=alias_blur)
+
+
+def defocus_blur(image, level=(1, 0.1)):
+ c = level
+ kernel = disk(radius=c[0], alias_blur=c[1])
+
+ channels = []
+ for d in range(3):
+ channels.append(cv2.filter2D(image[:, :, d], -1, kernel))
+ channels = np.array(channels).transpose((1, 2, 0)) # 3x64x64 -> 64x64x3
+
+ return np.clip(channels, 0, 1)
+
+
+def masks_CFA_Bayer(shape):
+ pattern = "RGGB"
+ channels = dict((channel, np.zeros(shape)) for channel in "RGB")
+ for channel, (y, x) in zip(pattern, [(0, 0), (0, 1), (1, 0), (1, 1)]):
+ channels[channel][y::2, x::2] = 1
+ return tuple(channels[c].astype(bool) for c in "RGB")
+
+
+def cfa4_to_rgb(CFA4):
+ RGB = np.zeros((CFA4.shape[0]*2, CFA4.shape[1]*2, 3), dtype=np.uint8)
+ RGB[0::2, 0::2, 0] = CFA4[:, :, 0] # R
+ RGB[0::2, 1::2, 1] = CFA4[:, :, 1] # G on R row
+ RGB[1::2, 0::2, 1] = CFA4[:, :, 2] # G on B row
+ RGB[1::2, 1::2, 2] = CFA4[:, :, 3] # B
+
+ return RGB
+
+
+def mosaic_CFA_Bayer(RGB):
+ RGB = single2uint(RGB)
+ R_m, G_m, B_m = masks_CFA_Bayer(RGB.shape[0:2])
+ mask = np.concatenate(
+ (R_m[..., np.newaxis], G_m[..., np.newaxis], B_m[..., np.newaxis]), axis=-1
+ )
+ mosaic = np.multiply(mask, RGB) # mask*RGB
+ CFA = mosaic.sum(2).astype(np.uint8)
+
+ CFA4 = np.zeros((RGB.shape[0] // 2, RGB.shape[1] // 2, 4), dtype=np.uint8)
+ CFA4[:, :, 0] = CFA[0::2, 0::2]
+ CFA4[:, :, 1] = CFA[0::2, 1::2]
+ CFA4[:, :, 2] = CFA[1::2, 0::2]
+ CFA4[:, :, 3] = CFA[1::2, 1::2]
+
+ rgb = cfa4_to_rgb(CFA4)
+ rgb = uint2single(rgb)
+ return rgb
+
+
+def simulate_barrel_distortion(image, k1=0.02, k2=0.01):
+ height, width = image.shape[:2]
+ mapx, mapy = np.meshgrid(np.arange(width), np.arange(height))
+ mapx = 2 * mapx / (width - 1) - 1
+ mapy = 2 * mapy / (height - 1) - 1
+ r = np.sqrt(mapx**2 + mapy**2)
+ mapx = mapx * (1 + k1 * r**2 + k2 * r**4)
+ mapy = mapy * (1 + k1 * r**2 + k2 * r**4)
+ mapx = (mapx + 1) * (width - 1) / 2
+ mapy = (mapy + 1) * (height - 1) / 2
+ distorted_image = cv2.remap(image, mapx.astype(np.float32), mapy.astype(np.float32), cv2.INTER_LINEAR)
+ return distorted_image
+
+
+def simulate_pincushion_distortion(image, k1=-0.02, k2=-0.01):
+ height, width = image.shape[:2]
+ mapx, mapy = np.meshgrid(np.arange(width), np.arange(height))
+ mapx = 2 * mapx / (width - 1) - 1
+ mapy = 2 * mapy / (height - 1) - 1
+ r = np.sqrt(mapx**2 + mapy**2)
+ mapx = mapx * (1 + k1 * r**2 + k2 * r**4)
+ mapy = mapy * (1 + k1 * r**2 + k2 * r**4)
+ mapx = (mapx + 1) * (width - 1) / 2
+ mapy = (mapy + 1) * (height - 1) / 2
+ distorted_image = cv2.remap(image, mapx.astype(np.float32), mapy.astype(np.float32), cv2.INTER_LINEAR)
+ return distorted_image
+
+
+def rgb2gray(rgb):
+ return np.dot(rgb[..., :3], [0.2989, 0.5870, 0.1140])
+
+
+def spatter(x, severity=1):
+ c = [(0.65, 0.3, 4, 0.69, 0.6, 0),
+ (0.65, 0.3, 3, 0.68, 0.6, 0),
+ (0.65, 0.3, 2, 0.68, 0.5, 0),
+ (0.65, 0.3, 1, 0.65, 1.5, 1),
+ (0.67, 0.4, 1, 0.65, 1.5, 1)][severity - 1]
+ x_PIL = x
+ x = np.array(x, dtype=np.float32) / 255.
+
+ liquid_layer = np.random.normal(size=x.shape[:2], loc=c[0], scale=c[1])
+
+ liquid_layer = gaussian(liquid_layer, sigma=c[2])
+ liquid_layer[liquid_layer < c[3]] = 0
+ if c[5] == 0:
+ liquid_layer = (liquid_layer * 255).astype(np.uint8)
+ dist = 255 - cv2.Canny(liquid_layer, 50, 150)
+ dist = cv2.distanceTransform(dist, cv2.DIST_L2, 5)
+ _, dist = cv2.threshold(dist, 20, 20, cv2.THRESH_TRUNC)
+ dist = cv2.blur(dist, (3, 3)).astype(np.uint8)
+ dist = cv2.equalizeHist(dist)
+ ker = np.array([[-2, -1, 0], [-1, 1, 1], [0, 1, 2]])
+ dist = cv2.filter2D(dist, cv2.CV_8U, ker)
+ dist = cv2.blur(dist, (3, 3)).astype(np.float32)
+
+ m = cv2.cvtColor(liquid_layer * dist, cv2.COLOR_GRAY2BGRA)
+ m /= np.max(m, axis=(0, 1))
+ m *= c[4]
+ # water is pale turqouise
+ color = np.concatenate((175 / 255. * np.ones_like(m[..., :1]),
+ 238 / 255. * np.ones_like(m[..., :1]),
+ 238 / 255. * np.ones_like(m[..., :1])), axis=2)
+
+ color = cv2.cvtColor(color, cv2.COLOR_BGR2BGRA)
+
+ if len(x.shape) < 3 or x.shape[2] < 3:
+ add_spatter_color = cv2.cvtColor(np.clip(m * color, 0, 1),
+ cv2.COLOR_BGRA2BGR)
+ add_spatter_gray = rgb2gray(add_spatter_color)
+
+ return (np.clip(x + add_spatter_gray, 0, 1) * 255).astype(np.uint8)
+
+ else:
+
+ x = cv2.cvtColor(x, cv2.COLOR_BGR2BGRA)
+
+ return (cv2.cvtColor(np.clip(x + m * color, 0, 1),
+ cv2.COLOR_BGRA2BGR) * 255).astype(np.uint8)
+ else:
+ m = np.where(liquid_layer > c[3], 1, 0)
+ m = gaussian(m.astype(np.float32), sigma=c[4])
+ m[m < 0.8] = 0
+
+ x_rgb = np.array(x_PIL)
+
+ # mud brown
+ color = np.concatenate((63 / 255. * np.ones_like(x_rgb[..., :1]),
+ 42 / 255. * np.ones_like(x_rgb[..., :1]),
+ 20 / 255. * np.ones_like(x_rgb[..., :1])),
+ axis=2)
+ color *= m[..., np.newaxis]
+ if len(x.shape) < 3 or x.shape[2] < 3:
+ x *= (1 - m)
+ return (np.clip(x + rgb2gray(color), 0, 1) * 255).astype(np.uint8)
+
+ else:
+ x *= (1 - m[..., np.newaxis])
+ return (np.clip(x + color, 0, 1) * 255).astype(np.uint8)
+
+
+# mod of https://gist.github.com/erniejunior/601cdf56d2b424757de5
+def elastic_transform(image, severity=3):
+ image = np.array(image, dtype=np.float32) / 255.
+ shape = image.shape
+ shape_size = shape[:2]
+
+ sigma = np.array(shape_size) * 0.01
+ alpha = [250 * 0.05, 250 * 0.065, 250 * 0.085, 250 * 0.1, 250 * 0.12][
+ severity - 1]
+ max_dx = shape[0] * 0.005
+ max_dy = shape[0] * 0.005
+
+ dx = (gaussian(np.random.uniform(-max_dx, max_dx, size=shape[:2]),
+ sigma, mode='reflect', truncate=3) * alpha).astype(
+ np.float32)
+ dy = (gaussian(np.random.uniform(-max_dy, max_dy, size=shape[:2]),
+ sigma, mode='reflect', truncate=3) * alpha).astype(
+ np.float32)
+
+ if len(image.shape) < 3 or image.shape[2] < 3:
+ x, y = np.meshgrid(np.arange(shape[1]), np.arange(shape[0]))
+ indices = np.reshape(y + dy, (-1, 1)), np.reshape(x + dx, (-1, 1))
+ else:
+ dx, dy = dx[..., np.newaxis], dy[..., np.newaxis]
+ x, y, z = np.meshgrid(np.arange(shape[1]), np.arange(shape[0]),
+ np.arange(shape[2]))
+ indices = np.reshape(y + dy, (-1, 1)), np.reshape(x + dx,
+ (-1, 1)), np.reshape(
+ z, (-1, 1))
+ return np.clip(
+ map_coordinates(image, indices, order=1, mode='reflect').reshape(
+ shape), 0, 1) * 255
+
+
+def frost(x, severity=2):
+ c = [(1, 0.4),
+ (0.8, 0.6),
+ (0.7, 0.7),
+ (0.65, 0.7),
+ (0.6, 0.75)][severity - 1]
+
+ idx = np.random.randint(5)
+ filename = [os.path.join("degradation_toolkit/frost", 'frost1.png'),
+ os.path.join("degradation_toolkit/frost", 'frost2.png'),
+ os.path.join("degradation_toolkit/frost", 'frost3.png'),
+ os.path.join("degradation_toolkit/frost", 'frost4.jpg'),
+ os.path.join("degradation_toolkit/frost", 'frost5.jpg'),
+ os.path.join("degradation_toolkit/frost", 'frost6.jpg')][idx]
+ frost = Image.open(filename)
+ frost = frost.convert("RGB")
+ frost = np.array(frost)
+ # frost = cv2.imread(filename)
+ frost = uint2single(frost)
+ frost_shape = frost.shape
+ x_shape = np.array(x).shape
+
+ # resize the frost image so it fits to the image dimensions
+ scaling_factor = 1
+ if frost_shape[0] >= x_shape[0] and frost_shape[1] >= x_shape[1]:
+ scaling_factor = 1
+ elif frost_shape[0] < x_shape[0] and frost_shape[1] >= x_shape[1]:
+ scaling_factor = x_shape[0] / frost_shape[0]
+ elif frost_shape[0] >= x_shape[0] and frost_shape[1] < x_shape[1]:
+ scaling_factor = x_shape[1] / frost_shape[1]
+ elif frost_shape[0] < x_shape[0] and frost_shape[1] < x_shape[
+ 1]: # If both dims are too small, pick the bigger scaling factor
+ scaling_factor_0 = x_shape[0] / frost_shape[0]
+ scaling_factor_1 = x_shape[1] / frost_shape[1]
+ scaling_factor = np.maximum(scaling_factor_0, scaling_factor_1)
+
+ scaling_factor *= 1.1
+ new_shape = (int(np.ceil(frost_shape[1] * scaling_factor)),
+ int(np.ceil(frost_shape[0] * scaling_factor)))
+ frost_rescaled = cv2.resize(frost, dsize=new_shape,
+ interpolation=cv2.INTER_CUBIC)
+
+ # randomly crop
+ x_start, y_start = np.random.randint(0, frost_rescaled.shape[0] - x_shape[
+ 0]), np.random.randint(0, frost_rescaled.shape[1] - x_shape[1])
+
+ if len(x_shape) < 3 or x_shape[2] < 3:
+ frost_rescaled = frost_rescaled[x_start:x_start + x_shape[0],
+ y_start:y_start + x_shape[1]]
+ frost_rescaled = rgb2gray(frost_rescaled)
+ else:
+ frost_rescaled = frost_rescaled[x_start:x_start + x_shape[0],
+ y_start:y_start + x_shape[1]][..., [2, 1, 0]]
+ return c[0] * np.array(x) + c[1] * frost_rescaled
diff --git a/data/degradation_toolkit/x_distortion/__init__.py b/data/degradation_toolkit/x_distortion/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..bd2be4b46ebd80a1208d641265a981b61fd3d9a4
--- /dev/null
+++ b/data/degradation_toolkit/x_distortion/__init__.py
@@ -0,0 +1,120 @@
+from .blur import *
+from .brightness import *
+from .quantization import *
+from .compression import *
+from .contrast import *
+from .noise import *
+from .oversharpen import *
+from .pixelate import *
+from .saturate import *
+
+
+def add_distortion(img, severity=1, distortion_name=None):
+ """This function returns a distorted version of the given image.
+
+ @param img (np.ndarray, unit8): Input image, H x W x 3, RGB, [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @distortion_name:
+ @return: Degraded image (np.ndarray, unit8), H x W x 3, RGB, [0, 255]
+ """
+
+ if not isinstance(img, np.ndarray):
+ raise AttributeError('Expecting type(img) to be numpy.ndarray')
+ if not (img.dtype.type is np.uint8):
+ raise AttributeError('Expecting img.dtype.type to be numpy.uint8')
+
+ if not (img.ndim in [2, 3]):
+ raise AttributeError('Expecting img.shape to be either (h x w) or (h x w x c)')
+ if img.ndim == 2:
+ img = np.stack((img,) * 3, axis=-1)
+
+ h, w, c = img.shape
+ if (h < 32 or w < 32):
+ raise AttributeError('The (w, h) must be at least 32 pixels')
+ if not (c in [1, 3]):
+ raise AttributeError('Expecting img to have either 1 or 3 chennels')
+ if c == 1:
+ img = np.stack((np.squeeze(img),) * 3, axis=-1)
+
+ if severity not in [1, 2, 3, 4, 5]:
+ raise AttributeError('The severity must be an integer in [1, 5]')
+
+ if distortion_name:
+ img_lq = globals()[distortion_name](img, severity)
+ else:
+ raise ValueError("The distortion_name must be passed")
+
+ return np.uint8(img_lq)
+
+
+distortions_dict = {
+ "blur": [
+ "blur_gaussian",
+ "blur_motion",
+ "blur_glass",
+ "blur_lens",
+ "blur_zoom",
+ "blur_jitter",
+ ],
+ "noise": [
+ "noise_gaussian_RGB",
+ "noise_gaussian_YCrCb",
+ "noise_speckle",
+ "noise_spatially_correlated",
+ "noise_poisson",
+ "noise_impulse",
+ ],
+ "compression": [
+ "compression_jpeg",
+ "compression_jpeg_2000",
+ ],
+ "brighten": [
+ "brightness_brighten_shfit_HSV",
+ "brightness_brighten_shfit_RGB",
+ "brightness_brighten_gamma_HSV",
+ "brightness_brighten_gamma_RGB",
+ ],
+ "darken": [
+ "brightness_darken_shfit_HSV",
+ "brightness_darken_shfit_RGB",
+ "brightness_darken_gamma_HSV",
+ "brightness_darken_gamma_RGB",
+ ],
+ "contrast_strengthen": [
+ "contrast_strengthen_scale",
+ "contrast_strengthen_stretch",
+ ],
+ "contrast_weaken": [
+ "contrast_weaken_scale",
+ "contrast_weaken_stretch",
+ ],
+ "saturate_strengthen": [
+ "saturate_strengthen_HSV",
+ "saturate_strengthen_YCrCb",
+ ],
+ "saturate_weaken": [
+ "saturate_weaken_HSV",
+ "saturate_weaken_YCrCb",
+ ],
+ "oversharpen": [
+ "oversharpen",
+ ],
+ "pixelate": [
+ "pixelate",
+ ],
+ "quantization": [
+ "quantization_otsu",
+ "quantization_median",
+ "quantization_hist",
+ ],
+ "spatter": [
+ "spatter",
+ ],
+}
+
+
+def get_distortion_names(subset=None):
+ if subset in distortions_dict:
+ print(distortions_dict[subset])
+ else:
+ print(distortions_dict)
diff --git a/data/degradation_toolkit/x_distortion/blur.py b/data/degradation_toolkit/x_distortion/blur.py
new file mode 100644
index 0000000000000000000000000000000000000000..3c42c0c743aac83abdf3267a75876c88ca4c5aee
--- /dev/null
+++ b/data/degradation_toolkit/x_distortion/blur.py
@@ -0,0 +1,155 @@
+import cv2
+import numpy as np
+
+from skimage.filters import gaussian
+from .helper import (
+ _motion_blur,
+ shuffle_pixels_njit,
+ clipped_zoom,
+ gen_disk,
+ gen_lensmask,
+)
+
+
+def blur_gaussian(img, severity=1):
+ """
+ Gaussian Blur.
+ severity=[1, 2, 3, 4, 5] corresponding to sigma=[1, 2, 3, 4, 5].
+ severity mainly refer to KADID-10K and Imagecorruptions.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [1, 2, 3, 4, 5][severity - 1]
+ img = np.array(img) / 255.
+ img = gaussian(img, sigma=c, channel_axis=-1)
+ img = np.clip(img, 0, 1) * 255
+ return img.round().astype(np.uint8)
+
+
+def blur_gaussian_lensmask(img, severity=1):
+ """
+ Gaussian Blur with Lens Mask.
+ severity=[1, 2, 3, 4, 5] corresponding to
+ [gamma, sigma]=[[2.0, 2], [2.4, 4], [3.0, 6], [3.8, 8], [5.0, 10]].
+ severity mainly refer to PieAPP.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [(2.0, 2), (2.4, 4), (3.0, 6), (3.8, 8), (5.0, 10)][severity - 1]
+ img_orig = np.array(img) / 255.
+ h, w = img.shape[:2]
+ mask = gen_lensmask(h, w, gamma=c[0])[:, :, None]
+ img = gaussian(img_orig, sigma=c[1], channel_axis=-1)
+ img = mask * img_orig + (1 - mask) * img
+ img = np.clip(img, 0, 1) * 255
+ return img.round().astype(np.uint8)
+
+
+def blur_motion(img, severity=1):
+ """
+ Motion Blur.
+ severity = [1, 2, 3, 4, 5] corresponding to radius=[5, 10, 15, 15, 20] and
+ sigma=[1, 2, 3, 4, 5].
+ severity mainly refer to Imagecorruptions.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [0, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [(5, 3), (10, 5), (15, 7), (15, 9), (20, 12)][severity - 1]
+ angle = np.random.uniform(-90, 90)
+ img = np.array(img)
+ img = _motion_blur(img, radius=c[0], sigma=c[1], angle=angle)
+ img = np.clip(img, 0, 255)
+ return img.round().astype(np.uint8)
+
+
+def blur_glass(img, severity=1):
+ """
+ Glass Blur.
+ severity = [1, 2, 3, 4, 5] corresponding to
+ [sigma, shift, iteration]=[(0.7, 1, 1), (0.9, 2, 1), (1.2, 2, 2), (1.4, 3, 2), (1.6, 4, 2)].
+ severity mainly refer to Imagecorruptions.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [0, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [(0.7, 1, 1), (0.9, 2, 1), (1.2, 2, 2), (1.4, 3, 2), (1.6, 4, 2)][severity - 1]
+ img = np.array(img) / 255.
+ img = gaussian(img, sigma=c[0], channel_axis=-1)
+ img = shuffle_pixels_njit(img, shift=c[1], iteration=c[2])
+ img = np.clip(gaussian(img, sigma=c[0], channel_axis=-1), 0, 1) * 255
+ return img.round().astype(np.uint8)
+
+
+def blur_lens(img, severity=1):
+ """
+ Lens Blur.
+ severity = [1, 2, 3, 4, 5] corresponding to radius=[2, 3, 4, 6, 8].
+ severity mainly refer to KADID-10K.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [0, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [2, 3, 4, 6, 8][severity - 1]
+ img = np.array(img) / 255.
+ kernel = gen_disk(radius=c)
+ img_lq = []
+ for i in range(3):
+ img_lq.append(cv2.filter2D(img[:, :, i], -1, kernel))
+ img_lq = np.array(img_lq).transpose((1, 2, 0))
+ img_lq = np.clip(img_lq, 0, 1) * 255
+ return img_lq.round().astype(np.uint8)
+
+
+def blur_zoom(img, severity=1):
+ """
+ Zoom Blur.
+ severity = [1, 2, 3, 4, 5] corresponding to radius=
+ [np.arange(1, 1.03, 0.02),
+ np.arange(1, 1.06, 0.02),
+ np.arange(1, 1.10, 0.02),
+ np.arange(1, 1.15, 0.02),
+ np.arange(1, 1.21, 0.02)].
+ severity mainly refer to Imagecorruptions.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [0, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [np.arange(1, 1.03, 0.02),
+ np.arange(1, 1.06, 0.02),
+ np.arange(1, 1.10, 0.02),
+ np.arange(1, 1.15, 0.02),
+ np.arange(1, 1.21, 0.02)][severity - 1]
+ img = (np.array(img) / 255.).astype(np.float32)
+ h, w = img.shape[:2]
+ img_lq = np.zeros_like(img)
+ for zoom_factor in c:
+ zoom_layer = clipped_zoom(img, zoom_factor)
+ img_lq += zoom_layer[:h, :w, :]
+ img_lq = (img + img_lq) / (len(c) + 1)
+ img_lq = np.clip(img_lq, 0, 1) * 255
+ return img_lq.round().astype(np.uint8)
+
+
+def blur_jitter(img, severity=1):
+ """
+ Jitter Blur.
+ severity = [1, 2, 3, 4, 5] corresponding to shift=[1, 2, 3, 4, 5].
+ severity mainly refer to KADID-10K.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [0, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [1, 2, 3, 4, 5][severity - 1]
+ img = np.array(img)
+ img_lq = shuffle_pixels_njit(img, shift=c, iteration=1)
+ return np.uint8(img_lq)
diff --git a/data/degradation_toolkit/x_distortion/brightness.py b/data/degradation_toolkit/x_distortion/brightness.py
new file mode 100644
index 0000000000000000000000000000000000000000..ea64e820ff5a7db695d3b0178913e40225898d2b
--- /dev/null
+++ b/data/degradation_toolkit/x_distortion/brightness.py
@@ -0,0 +1,150 @@
+import numpy as np
+import cv2
+from .helper import gen_lensmask
+
+
+def brightness_brighten_shfit_HSV(img, severity=1):
+ """
+ The RGB image is mapping to HSV, and then enhance the brightness by V channel
+ severity=[1,2,3,4,5] is corresponding to c=[0.1, 0.2, 0.3, 0.4, 0.5]
+
+ @param img: Input image, H x W x RGB, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x RGB, value range [0, 255]
+ """
+ c = [0.1, 0.2, 0.3, 0.4, 0.5][severity-1]
+ img = np.float32(np.array(img) / 255.)
+ img_hsv = cv2.cvtColor(img, cv2.COLOR_RGB2HSV)
+ img_hsv[:, :, 2] += c
+ img_lq = cv2.cvtColor(img_hsv, cv2.COLOR_HSV2RGB)
+ return np.uint8(np.clip(img_lq, 0, 1) * 255.)
+
+
+def brightness_brighten_shfit_RGB(img, severity=1):
+ """
+ The RGB image is directly enhanced by RGB mean shift
+ severity=[1,2,3,4,5] is corresponding to c=[0.1, 0.15, 0.2, 0.27, 0.35]
+
+ @param img: Input image, H x W x RGB, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x RGB, value range [0, 255]
+ """
+ c = [0.1, 0.15, 0.2, 0.27, 0.35][severity-1]
+ img = np.float32(np.array(img) / 255.)
+ img_lq = img + c
+ return np.uint8(np.clip(img_lq, 0, 1) * 255.)
+
+
+def brightness_brighten_gamma_RGB(img, severity=1):
+ """
+ The RGB image is enhanced by V channel with a gamma function
+ severity=[1,2,3,4,5] is corresponding to gamma=[0.8, 0.7, 0.6, 0.45, 0.3]
+
+ @param img: Input image, H x W x RGB, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x RGB, value range [0, 255]
+ """
+ gamma = [0.8, 0.7, 0.6, 0.45, 0.3][severity-1]
+ img = np.array(img / 255.)
+ img_lq = img ** gamma
+ return np.uint8(np.clip(img_lq, 0, 1) * 255.)
+
+
+def brightness_brighten_gamma_HSV(img, severity=1):
+ """
+ The RGB image is enhanced by V channel with a gamma function
+ severity=[1,2,3,4,5] is corresponding to gamma=[0.7, 0.55, 0.4, 0.25, 0.1]
+
+ @param img: Input image, H x W x RGB, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x RGB, value range [0, 255]
+ """
+ gamma = [0.7, 0.58, 0.47, 0.36, 0.25][severity-1]
+ img_hsv = cv2.cvtColor(img, cv2.COLOR_RGB2HSV)
+ img_hsv = np.array(img_hsv / 255.)
+ img_hsv[:, :, 2] = img_hsv[:, :, 2] ** gamma
+ img_lq = np.uint8(np.clip(img_hsv, 0, 1) * 255.)
+ img_lq = cv2.cvtColor(img_lq, cv2.COLOR_HSV2RGB)
+ return img_lq
+
+
+def brightness_darken_shfit_HSV(img, severity=1):
+ """
+ The RGB image is mapping to HSV, and then darken the brightness by V channel
+ severity=[1,2,3,4,5] is corresponding to c=[0.1, 0.2, 0.3, 0.4, 0.5]
+
+ @param img: Input image, H x W x RGB, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x RGB, value range [0, 255]
+ """
+ c = [0.1, 0.2, 0.3, 0.4, 0.5][severity-1]
+ img = np.float32(np.array(img) / 255.)
+ img_hsv = cv2.cvtColor(img, cv2.COLOR_RGB2HSV)
+ img_hsv[:, :, 2] -= c
+ img_lq = cv2.cvtColor(img_hsv, cv2.COLOR_HSV2RGB)
+ return np.uint8(np.clip(img_lq, 0, 1) * 255.)
+
+
+def brightness_darken_shfit_RGB(img, severity=1):
+ """
+ The RGB image's brightness is directly reduced by RGB mean shift
+ severity=[1,2,3,4,5] is corresponding to c=[0.1, 0.15, 0.2, 0.27, 0.35]
+
+ @param img: Input image, H x W x RGB, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x RGB, value range [0, 255]
+ """
+ c = [0.1, 0.15, 0.2, 0.27, 0.35][severity-1]
+ img = np.float32(np.array(img)/255.)
+ img_lq = img - c
+ return np.uint8(np.clip(img_lq, 0, 1) * 255.)
+
+
+def brightness_darken_gamma_RGB(img, severity=1):
+ """
+ The RGB image is darkened by V channel with a gamma function
+ severity=[1,2,3,4,5] is corresponding to gamma=[1.4, 1.7, 2.1, 2.6, 3.2]
+
+ @param img: Input image, H x W x RGB, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x RGB, value range [0, 255]
+ """
+ gamma = [1.4, 1.7, 2.1, 2.6, 3.2][severity-1]
+ img = np.array(img / 255.)
+ img_lq = img ** gamma
+ return np.uint8(np.clip(img_lq, 0, 1) * 255.)
+
+
+def brightness_darken_gamma_HSV(img, severity=1):
+ """
+ The RGB image is enhanced by V channel with a gamma function
+ severity=[1,2,3,4,5] is corresponding to gamma=[1.5, 1.8, 2.2, 2.7, 3.5]
+
+ @param img: Input image, H x W x RGB, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x RGB, value range [0, 255]
+ """
+ gamma = [1.5, 1.8, 2.2, 2.7, 3.5][severity-1]
+ img_hsv = cv2.cvtColor(img, cv2.COLOR_RGB2HSV)
+ img_hsv = np.array(img_hsv / 255.)
+ img_hsv[:, :, 2] = img_hsv[:, :, 2] ** gamma
+ img_lq = np.uint8(np.clip(img_hsv, 0, 1) * 255.)
+ img_lq = cv2.cvtColor(img_lq, cv2.COLOR_HSV2RGB)
+ return img_lq
+
+
+def brightness_vignette(img, severity=1):
+ """
+ The RGB image is suffered from the vignette effect.
+ severity=[1,2,3,4,5] is corresponding to gamma=[0.5, 0.875, 1.25, 1.625, 2]
+
+ @param img: Input image, H x W x RGB, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x RGB, value range [0, 255]
+ """
+ gamma = [0.5, 0.875, 1.25, 1.625, 2][severity - 1]
+ img = np.array(img)
+ h, w = img.shape[:2]
+ mask = gen_lensmask(h, w, gamma=gamma)[:, :, None]
+ img_lq = mask * img
+ return np.uint8(np.clip(img_lq, 0, 255))
diff --git a/data/degradation_toolkit/x_distortion/compression.py b/data/degradation_toolkit/x_distortion/compression.py
new file mode 100644
index 0000000000000000000000000000000000000000..e6934ee3d7d3a0b1a58554f31d53ee1fb499d4cb
--- /dev/null
+++ b/data/degradation_toolkit/x_distortion/compression.py
@@ -0,0 +1,78 @@
+import numpy as np
+from PIL import Image
+from io import BytesIO
+
+
+def compression_jpeg(img, severity=1):
+ """
+ JPEG compression on a NumPy array.
+ severity=[1,2,3,4,5] corresponding to quality=[25,18,15,10,7].
+ from https://github.com/bethgelab/imagecorruptions/blob/master/imagecorruptions/corruptions.py
+
+ @param img: Input image as NumPy array, H x W x C, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image as NumPy array, H x W x C, value range [0, 255]
+ """
+ assert img.dtype == np.uint8, "Image array should have dtype of np.uint8"
+ assert severity in [1, 2, 3, 4, 5], 'Severity must be an integer between 1 and 5.'
+
+ quality = [25, 18, 12, 8, 5][severity - 1]
+ output = BytesIO()
+ gray_scale = False
+ if img.shape[2] == 1: # Check if the image is grayscale
+ gray_scale = True
+ # Convert NumPy array to PIL Image
+ img = Image.fromarray(img)
+ if gray_scale:
+ img = img.convert('L')
+ else:
+ img = img.convert('RGB')
+ # Save image to a bytes buffer using JPEG compression
+ img.save(output, 'JPEG', quality=quality)
+ output.seek(0)
+ # Load the compressed image from the bytes buffer
+ img_lq = Image.open(output)
+ # Convert PIL Image back to NumPy array
+ if gray_scale:
+ img_lq = np.array(img_lq.convert('L'))
+ img_lq = img_lq.reshape((img_lq.shape[0], img_lq.shape[1], 1)) # Maintaining the original shape (H, W, 1)
+ else:
+ img_lq = np.array(img_lq.convert('RGB'))
+ return img_lq
+
+
+def compression_jpeg_2000(img, severity=1):
+ """
+ JPEG2000 compression on a NumPy array.
+ severity=[1,2,3,4,5] corresponding to quality=[29,27.5,26,24.5,23], quality_mode='dB'.
+
+ @param x: Input image as NumPy array, H x W x C, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image as NumPy array, H x W x C, value range [0, 255]
+ """
+ assert img.dtype == np.uint8, "Image array should have dtype of np.uint8"
+ assert severity in [1, 2, 3, 4, 5], 'Severity must be an integer between 1 and 5.'
+
+ quality = [29, 27.5, 26, 24.5, 23][severity - 1]
+ output = BytesIO()
+ gray_scale = False
+ if img.shape[2] == 1: # Check if the image is grayscale
+ gray_scale = True
+ # Convert NumPy array to PIL Image
+ img = Image.fromarray(img)
+ if gray_scale:
+ img = img.convert('L')
+ else:
+ img = img.convert('RGB')
+ # Save image to a bytes buffer using JPEG compression
+ img.save(output, 'JPEG2000', quality_mode='dB', quality_layers=[quality])
+ output.seek(0)
+ # Load the compressed image from the bytes buffer
+ img_lq = Image.open(output)
+ # Convert PIL Image back to NumPy array
+ if gray_scale:
+ img_lq = np.array(img_lq.convert('L'))
+ img_lq = img_lq.reshape((img_lq.shape[0], img_lq.shape[1], 1)) # Maintaining the original shape (H, W, 1)
+ else:
+ img_lq = np.array(img_lq.convert('RGB'))
+ return img_lq
diff --git a/data/degradation_toolkit/x_distortion/contrast.py b/data/degradation_toolkit/x_distortion/contrast.py
new file mode 100644
index 0000000000000000000000000000000000000000..707c1e65ce44ea5291a7525b1c16f196d100d6c3
--- /dev/null
+++ b/data/degradation_toolkit/x_distortion/contrast.py
@@ -0,0 +1,74 @@
+import cv2
+import numpy as np
+from PIL import Image
+from PIL import ImageEnhance
+
+
+def contrast_weaken_scale(img, severity=1):
+ """
+ Contrast Weaken by scaling.
+ severity=[1, 2, 3, 4, 5] corresponding to scale=[0.75, 0.6, 0.45, 0.3, 0.2].
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [0.75, 0.6, 0.45, 0.3, 0.2][severity - 1]
+ img = Image.fromarray(img)
+ enhancer = ImageEnhance.Contrast(img)
+ img = enhancer.enhance(c)
+ img = np.uint8(np.clip(np.array(img), 0, 255))
+ return img
+
+
+def contrast_weaken_stretch(img, severity=1):
+ """
+ Contrast Weaken by stretching.
+ severity=[1, 2, 3, 4, 5] corresponding to scale=[1.0, 0.9, 0.8, 0.6, 0.4].
+ severity mainly refer to PieAPP.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [1.0, 0.9, 0.8, 0.6, 0.4][severity - 1]
+ img = np.array(img) / 255.
+ img_mean = np.mean(img, axis=(0,1), keepdims=True)
+ img = 1. / (1 + (img_mean / (img + 1e-12)) ** c)
+ img = np.uint8(np.clip(img, 0, 1) * 255)
+ return img
+
+
+def contrast_strengthen_scale(img, severity=1):
+ """
+ Contrast Strengthen by scaling.
+ severity=[1, 2, 3, 4, 5] corresponding to scale=[1.4, 1.7, 2.1, 2.6, 4.0].
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [1.4, 1.7, 2.1, 2.6, 4.0][severity - 1]
+ img = Image.fromarray(img)
+ enhancer = ImageEnhance.Contrast(img)
+ img = enhancer.enhance(c)
+ img = np.uint8(np.clip(np.array(img), 0, 255))
+ return img
+
+
+def contrast_strengthen_stretch(img, severity=1):
+ """
+ Contrast Strengthen by stretching.
+ severity=[1, 2, 3, 4, 5] corresponding to scale=[2.0, 4.0, 6.0, 8.0, 10.0].
+ severity mainly refer to PieAPP.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [2.0, 4.0, 6.0, 8.0, 10.0][severity - 1]
+ img = np.array(img) / 255.
+ img_mean = np.mean(img, axis=(0,1), keepdims=True)
+ img = 1. / (1 + (img_mean / (img + 1e-12)) ** c)
+ img = np.uint8(np.clip(img, 0, 1) * 255)
+ return img
diff --git a/data/degradation_toolkit/x_distortion/helper.py b/data/degradation_toolkit/x_distortion/helper.py
new file mode 100644
index 0000000000000000000000000000000000000000..176674063bbc519e075a71828b7602164a3df68d
--- /dev/null
+++ b/data/degradation_toolkit/x_distortion/helper.py
@@ -0,0 +1,171 @@
+import cv2
+from scipy.ndimage import zoom as scizoom
+from numba import njit, prange
+import numpy as np
+import math
+
+
+def gen_lensmask(h, w, gamma):
+ """
+ Generate lens mask with shape (h, w).
+ For point (i, j),
+ distance = [(i - h // 2)^2 + (j - w // 2)^2] ^ (1/2) / [h // 2)^2 + (w // 2)^2] ^ (1/2)
+ mask = scale * (1 - distance) ^ gamma
+
+ @param h: height
+ @param w: width
+ @param gamma: exponential factor
+ @return: Mask, H x W
+ """
+ dist1 = np.array([list(range(w))] * h) - w // 2
+ dist2 = np.array([list(range(h))] * w) - h // 2
+ dist2 = np.transpose(dist2, (1, 0))
+ dist = np.sqrt((dist1 ** 2 + dist2 ** 2)) / np.sqrt((w ** 2 + h ** 2) / 4)
+ mask = (1 - dist) ** gamma
+ return mask
+
+
+def gen_disk(radius, dtype=np.float32):
+ if radius <= 8:
+ L = np.arange(-8, 8 + 1)
+ else:
+ L = np.arange(-radius, radius + 1)
+ X, Y = np.meshgrid(L, L)
+ disk = np.array((X ** 2 + Y ** 2) <= radius ** 2, dtype=dtype)
+ disk /= np.sum(disk)
+ return disk
+
+
+# modification of https://github.com/FLHerne/mapgen/blob/master/diamondsquare.py
+def plasma_fractal(mapsize=256, wibbledecay=3):
+ """
+ Generate a heightmap using diamond-square algorithm.
+ Return square 2d array, side length 'mapsize', of floats in range 0-255.
+ 'mapsize' must be a power of two.
+ """
+ assert (mapsize & (mapsize - 1) == 0)
+ maparray = np.empty((mapsize, mapsize), dtype=np.float_)
+ maparray[0, 0] = 0
+ stepsize = mapsize
+ wibble = 100
+
+ def wibbledmean(array):
+ return array / 4 + wibble * np.random.uniform(-wibble, wibble,
+ array.shape)
+
+ def fillsquares():
+ """For each square of points stepsize apart,
+ calculate middle value as mean of points + wibble"""
+ cornerref = maparray[0:mapsize:stepsize, 0:mapsize:stepsize]
+ squareaccum = cornerref + np.roll(cornerref, shift=-1, axis=0)
+ squareaccum += np.roll(squareaccum, shift=-1, axis=1)
+ maparray[stepsize // 2:mapsize:stepsize,
+ stepsize // 2:mapsize:stepsize] = wibbledmean(squareaccum)
+
+ def filldiamonds():
+ """For each diamond of points stepsize apart,
+ calculate middle value as mean of points + wibble"""
+ mapsize = maparray.shape[0]
+ drgrid = maparray[stepsize // 2:mapsize:stepsize,
+ stepsize // 2:mapsize:stepsize]
+ ulgrid = maparray[0:mapsize:stepsize, 0:mapsize:stepsize]
+ ldrsum = drgrid + np.roll(drgrid, 1, axis=0)
+ lulsum = ulgrid + np.roll(ulgrid, -1, axis=1)
+ ltsum = ldrsum + lulsum
+ maparray[0:mapsize:stepsize,
+ stepsize // 2:mapsize:stepsize] = wibbledmean(ltsum)
+ tdrsum = drgrid + np.roll(drgrid, 1, axis=1)
+ tulsum = ulgrid + np.roll(ulgrid, -1, axis=0)
+ ttsum = tdrsum + tulsum
+ maparray[stepsize // 2:mapsize:stepsize,
+ 0:mapsize:stepsize] = wibbledmean(ttsum)
+
+ while stepsize >= 2:
+ fillsquares()
+ filldiamonds()
+ stepsize //= 2
+ wibble /= wibbledecay
+
+ maparray -= maparray.min()
+ return maparray / maparray.max()
+
+
+def clipped_zoom(img, zoom_factor):
+ # clipping along the width dimension:
+ ch0 = int(np.ceil(img.shape[0] / float(zoom_factor)))
+ top0 = (img.shape[0] - ch0) // 2
+
+ # clipping along the height dimension:
+ ch1 = int(np.ceil(img.shape[1] / float(zoom_factor)))
+ top1 = (img.shape[1] - ch1) // 2
+
+ img = scizoom(img[top0:top0 + ch0, top1:top1 + ch1],
+ (zoom_factor, zoom_factor, 1), order=1)
+
+ return img
+
+
+def getOptimalKernelWidth1D(radius, sigma):
+ return radius * 2 + 1
+
+
+def gauss_function(x, mean, sigma):
+ return (np.exp(- (x - mean)**2 / (2 * (sigma**2)))) / (np.sqrt(2 * np.pi) * sigma)
+
+
+def getMotionBlurKernel(width, sigma):
+ k = gauss_function(np.arange(width), 0, sigma)
+ Z = np.sum(k)
+ return k/Z
+
+
+def shift(image, dx, dy):
+ if(dx < 0):
+ shifted = np.roll(image, shift=image.shape[1]+dx, axis=1)
+ shifted[:,dx:] = shifted[:,dx-1:dx]
+ elif(dx > 0):
+ shifted = np.roll(image, shift=dx, axis=1)
+ shifted[:,:dx] = shifted[:,dx:dx+1]
+ else:
+ shifted = image
+
+ if(dy < 0):
+ shifted = np.roll(shifted, shift=image.shape[0]+dy, axis=0)
+ shifted[dy:,:] = shifted[dy-1:dy,:]
+ elif(dy > 0):
+ shifted = np.roll(shifted, shift=dy, axis=0)
+ shifted[:dy,:] = shifted[dy:dy+1,:]
+ return shifted
+
+
+def _motion_blur(x, radius, sigma, angle):
+ width = getOptimalKernelWidth1D(radius, sigma)
+ kernel = getMotionBlurKernel(width, sigma)
+ point = (width * np.sin(np.deg2rad(angle)), width * np.cos(np.deg2rad(angle)))
+ hypot = math.hypot(point[0], point[1])
+
+ blurred = np.zeros_like(x, dtype=np.float32)
+ for i in range(width):
+ dy = -math.ceil(((i*point[0]) / hypot) - 0.5)
+ dx = -math.ceil(((i*point[1]) / hypot) - 0.5)
+ if (np.abs(dy) >= x.shape[0] or np.abs(dx) >= x.shape[1]):
+ # simulated motion exceeded image borders
+ break
+ shifted = shift(x, dx, dy)
+ blurred = blurred + kernel[i] * shifted
+ return blurred
+
+
+# Numba nopython compilation to shuffle_pixles
+@njit()
+def shuffle_pixels_njit(img, shift, iteration):
+ height, width = img.shape[:2]
+ # locally shuffle pixels
+ for _ in range(iteration):
+ for h in range(height - shift, shift, -1):
+ for w in range(width - shift, shift, -1):
+ dx, dy = np.random.randint(-shift, shift, size=(2,))
+ h_prime, w_prime = h + dy, w + dx
+ # swap
+ img[h, w], img[h_prime, w_prime] = img[h_prime, w_prime], img[h, w]
+ return img
diff --git a/data/degradation_toolkit/x_distortion/noise.py b/data/degradation_toolkit/x_distortion/noise.py
new file mode 100644
index 0000000000000000000000000000000000000000..8661fc6b38c6899d26a0a17574461b6c0136df4e
--- /dev/null
+++ b/data/degradation_toolkit/x_distortion/noise.py
@@ -0,0 +1,117 @@
+import cv2
+import numpy as np
+import skimage as sk
+
+
+def noise_gaussian_RGB(img, severity=1):
+ """
+ Additive Gaussian noise in RGB channels.
+ severity=[1, 2, 3, 4, 5] is corresponding to sigma=[0.05, 0.1, 0.15, 0.2, 0.25].
+ severity mainly refer to KADID-10K and Imagecorruptions.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ sigma = [0.05, 0.1, 0.15, 0.2, 0.25][severity-1]
+ img = np.array(img) / 255.
+ noise = np.random.normal(0, sigma, img.shape)
+ img_lq = img + noise
+ return np.uint8(np.clip(img_lq, 0, 1) * 255.)
+
+
+def noise_gaussian_YCrCb(img, severity=1):
+ """
+ Additive Gaussian noise with higher noise in color channels.
+ severity=[1, 2, 3, 4, 5] is corresponding to
+ sigma_l=[0.05, 0.06, 0.07, 0.08, 0.09],
+ sigma_r=[1, 1.45, 1.9, 2.35, 2.8],
+ sigma_b=[1, 1.45, 1.9, 2.35, 2.8].
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ sigma_l = [0.05, 0.06, 0.07, 0.08, 0.09][severity-1]
+ sigma_r = sigma_l * [1, 1.45, 1.9, 2.35, 2.8][severity - 1]
+ sigma_b = sigma_l * [1, 1.45, 1.9, 2.35, 2.8][severity - 1]
+ h, w = img.shape[:2]
+ img = np.float32(np.array(img) / 255.)
+ img = cv2.cvtColor(img, cv2.COLOR_RGB2YCR_CB)
+ noise_l = np.expand_dims(np.random.normal(0, sigma_l, (h, w)), 2)
+ noise_r = np.expand_dims(np.random.normal(0, sigma_r, (h, w)), 2)
+ noise_b = np.expand_dims(np.random.normal(0, sigma_b, (h, w)), 2)
+ noise = np.concatenate((noise_l, noise_r, noise_b), axis=2)
+ img_lq = np.float32(img + noise)
+ img_lq = cv2.cvtColor(img_lq, cv2.COLOR_YCR_CB2RGB)
+ return np.uint8(np.clip(img_lq, 0, 1) * 255.)
+
+
+def noise_speckle(img, severity=1):
+ """
+ Multiplicative Gaussian noise.
+ severity=[1, 2, 3, 4, 5] is corresponding to sigma=[0.14, 0.21, 0.28, 0.35, 0.42].
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [0.14, 0.21, 0.28, 0.35, 0.42][severity - 1]
+ img = np.array(img) / 255.
+ noise = img * np.random.normal(size=img.shape, scale=c)
+ img_lq = img + noise
+ return np.uint8(np.clip(img_lq, 0, 1) * 255.)
+
+
+def noise_spatially_correlated(img, severity=1):
+ """
+ Spatially correlated noise.
+ severity=[1, 2, 3, 4, 5] is corresponding to sigma=[0.08, 0.11, 0.14, 0.18, 0.22].
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ sigma = [0.08, 0.11, 0.14, 0.18, 0.22][severity - 1]
+ img = np.array(img) / 255.
+ noise = np.random.normal(0, sigma, img.shape)
+ img_lq = img + noise
+ img_lq = cv2.blur(img_lq, [3, 3])
+ return np.uint8(np.clip(img_lq, 0, 1) * 255.)
+
+
+def noise_poisson(img, severity=1):
+ """
+ Poisson noise.
+ PieAPP keeps this distortion free of additional parameters.
+ The default:
+ c = vals = len(np.unique(image))
+ vals = 2 ** np.ceil(np.log2(vals))
+ But Imagecorruptions introduces a extra parameter c
+ ranging [60, 25, 12, 5, 3] for sigma = sqrt(I / c).
+ severity=[1, 2, 3, 4, 5] is corresponding to c=[80, 60, 40, 25, 15].
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [80, 60, 40, 25, 15][severity - 1]
+ img = np.array(img) / 255.
+ img_lq = np.random.poisson(img * c) / float(c)
+ return np.uint8(np.clip(img_lq, 0, 1) * 255.)
+
+
+def noise_impulse(img, severity=1):
+ """
+ Impulse noise is also known as salt&pepper noise.
+ PieAPP introduce the range [1e-4, 0.045].
+ severity=[1, 2, 3, 4, 5] is corresponding to amount=[0.01, 0.03, 0.05, 0.07, 0.10].
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [0.01, 0.03, 0.05, 0.07, 0.10][severity - 1]
+ img = np.array(img) / 255.
+ img_lq = sk.util.random_noise(img, mode='s&p', amount=c)
+ return np.uint8(np.clip(img_lq, 0, 1) * 255.)
diff --git a/data/degradation_toolkit/x_distortion/oversharpen.py b/data/degradation_toolkit/x_distortion/oversharpen.py
new file mode 100644
index 0000000000000000000000000000000000000000..f8326a7e42292a1551493ae28fc2bb2ac9810857
--- /dev/null
+++ b/data/degradation_toolkit/x_distortion/oversharpen.py
@@ -0,0 +1,31 @@
+import cv2
+import numpy as np
+
+
+def oversharpen(img, severity=1):
+ """
+ OverSharpening filter on a NumPy array.
+ severity = [1, 5] corresponding to amount = [2, 4, 6, 8, 10]
+
+ @param x: Input image as NumPy array, H x W x C, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image as NumPy array, H x W x C, value range [0, 255]
+ """
+ assert img.dtype == np.uint8, "Image array should have dtype of np.uint8"
+ assert severity in [1, 2, 3, 4, 5], 'Severity must be an integer between 1 and 5.'
+
+ amount = [2, 2.8, 4, 6, 8][severity - 1]
+
+ # Setting the kernel size and sigmaX value for Gaussian blur
+ # In OpenCV's Size(kernel_width, kernel_height), both kernel_width and kernel_height
+ # should be odd numbers; for example, we can use (2*radius+1, 2*radius+1)
+ blur_radius = 2 # The radius is the blur radius used to set the size of the Gaussian kernel
+ sigmaX = 0
+
+ # Create a blurred/smoothed version of the image
+ blurred = cv2.GaussianBlur(img, (2*blur_radius+1, 2*blur_radius+1), sigmaX)
+
+ # Compute the sharpened image with an enhancement factor of 'amount'
+ sharpened = cv2.addWeighted(img, 1 + amount, blurred, -amount, 0)
+
+ return sharpened
diff --git a/data/degradation_toolkit/x_distortion/pixelate.py b/data/degradation_toolkit/x_distortion/pixelate.py
new file mode 100644
index 0000000000000000000000000000000000000000..b495e3aa479cf421483601f61d8d00f8ada6e737
--- /dev/null
+++ b/data/degradation_toolkit/x_distortion/pixelate.py
@@ -0,0 +1,21 @@
+import numpy as np
+
+from PIL import Image
+
+
+def pixelate(img, severity=1):
+ """
+ Pixelate.
+ severity=[1, 2, 3, 4, 5] corresponding to sigma=[0.5, 0.4, 0.3, 0.25, 0.2].
+ severity mainly refer to Imagecorruptions.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [0.5, 0.4, 0.3, 0.25, 0.2][severity - 1]
+ h, w = np.array(img).shape[:2]
+ img = Image.fromarray(img)
+ img = img.resize((int(w * c), int(h * c)), Image.BOX)
+ img = img.resize((w, h), Image.NEAREST)
+ return np.array(img).astype(np.uint8)
diff --git a/data/degradation_toolkit/x_distortion/quantization.py b/data/degradation_toolkit/x_distortion/quantization.py
new file mode 100644
index 0000000000000000000000000000000000000000..a3b59ed2092de03473e5f008fe758f82aa1faa0b
--- /dev/null
+++ b/data/degradation_toolkit/x_distortion/quantization.py
@@ -0,0 +1,68 @@
+import numpy as np
+
+from PIL import Image
+from skimage.filters import threshold_multiotsu
+
+
+
+def quantization_otsu(img, severity=1):
+ """
+ Color Quantization using OTSU method.
+ severity=[1, 2, 3, 4, 5] corresponding to num_classes=[15, 11, 8, 5, 3].
+ severity mainly refer to KADID-10K and Imagecorruptions.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [15, 11, 8, 5, 3][severity - 1]
+ img = np.array(img).astype(np.float32)
+ for i in range(img.shape[2]):
+ img_gray = img[:, :, i]
+ thresholds = threshold_multiotsu(img_gray, classes=c, nbins=30) # modify skimage
+ v_max = img_gray.max()
+ v_min = img_gray.min()
+ img[:, :, i] = np.digitize(img[:, :, i], bins=thresholds) * (v_max - v_min) / c + v_min
+ img = np.clip(img, 0, 255)
+ return img
+
+
+def quantization_median(img, severity=1):
+ """
+ Color Quantization using Histogram Median.
+ severity=[1, 2, 3, 4, 5] corresponding to num_classes=[20, 15, 10, 6, 3].
+ severity mainly refer to KADID-10K and Imagecorruptions.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [20, 15, 10, 6, 3][severity - 1]
+ for i in range(img.shape[2]):
+ img_gray = Image.fromarray(img[:, :, i])
+ img_gray = img_gray.quantize(colors=c, method=Image.Quantize.MEDIANCUT).convert("L")
+ img[:, :, i] = np.array(img_gray)
+ img = np.clip(img, 0, 255)
+ return img
+
+
+def quantization_hist(img, severity=1):
+ """
+ Color Quantization using Histogram Equalization.
+ severity=[1, 2, 3, 4, 5] corresponding to num_classes=[24, 16, 8, 6, 4].
+ severity mainly refer to KADID-10K and Imagecorruptions.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [24, 16, 8, 6, 4][severity - 1]
+ hist, _ = np.histogram(img.flatten(), bins=c, range=[0, 255])
+ cdf = hist.cumsum()
+ cdf_m = np.ma.masked_equal(cdf, 0)
+ cdf_m = (cdf_m - cdf_m.min()) * 255 / (cdf_m.max() - cdf_m.min())
+ cdf = np.ma.filled(cdf_m, 0).astype('uint8')
+ img = np.uint8(np.round(img / 255 * (c - 1)))
+ img = cdf[img]
+ img = np.clip(img, 0, 255)
+ return img
diff --git a/data/degradation_toolkit/x_distortion/saturate.py b/data/degradation_toolkit/x_distortion/saturate.py
new file mode 100644
index 0000000000000000000000000000000000000000..7943f2007464a907d7da061f6cc18b0d5a731859
--- /dev/null
+++ b/data/degradation_toolkit/x_distortion/saturate.py
@@ -0,0 +1,75 @@
+import cv2
+import numpy as np
+
+
+def saturate_weaken_HSV(img, severity=1):
+ """
+ Saturate Weaken by scaling S channel in HSV.
+ severity=[1, 2, 3, 4, 5] corresponding to scale=[0.7, 0.55, 0.4, 0.2, 0.0].
+ severity mainly refer to KADID-10K.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [0.7, 0.55, 0.4, 0.2, 0.0][severity - 1]
+ hsv = np.array(cv2.cvtColor(img, cv2.COLOR_RGB2HSV), dtype=np.float32)
+ hsv[:, :, 1] = c * hsv[:, :, 1]
+ hsv = np.uint8(np.clip(hsv, 0, 255))
+ img = cv2.cvtColor(hsv, cv2.COLOR_HSV2RGB)
+ return img
+
+
+def saturate_weaken_YCrCb(img, severity=1):
+ """
+ Saturate Weaken by scaling S channel in YCrCb.
+ severity=[1, 2, 3, 4, 5] corresponding to scale=[0.6, 0.4, 0.2, 0.1, 0.0].
+ severity mainly refer to PieAPP.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [0.6, 0.4, 0.2, 0.1, 0.0][severity - 1]
+ ycrcb = np.array(cv2.cvtColor(img, cv2.COLOR_RGB2YCR_CB), dtype=np.float32)
+ ycrcb[:, :, 1] = 128 + (ycrcb[:, :, 1] - 128) * c
+ ycrcb[:, :, 2] = 128 + (ycrcb[:, :, 2] - 128) * c
+ ycrcb = np.uint8(np.clip(ycrcb, 0, 255))
+ img = cv2.cvtColor(ycrcb, cv2.COLOR_YCR_CB2RGB)
+ return img
+
+
+def saturate_strengthen_HSV(img, severity=1):
+ """
+ Saturate Strengthen by scaling S channel in HSV.
+ severity=[1, 2, 3, 4, 5] corresponding to scale=[3.0, 6.0, 12.0, 20.0, 64.0].
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [3.0, 6.0, 12.0, 20.0, 64.0][severity - 1]
+ hsv = np.array(cv2.cvtColor(img, cv2.COLOR_RGB2HSV), dtype=np.float32)
+ hsv[:, :, 1] = c * hsv[:, :, 1]
+ hsv = np.uint8(np.clip(hsv, 0, 255))
+ img = cv2.cvtColor(hsv, cv2.COLOR_HSV2RGB)
+ return img
+
+
+def saturate_strengthen_YCrCb(img, severity=1):
+ """
+ Saturate Strengthen by scaling S channel in YCrCb.
+ severity=[1, 2, 3, 4, 5] corresponding to scale=[2.0, 3.0, 5.0, 8.0, 16.0].
+ severity mainly refer to PieAPP.
+
+ @param img: Input image, H x W x 3, value range [0, 255]
+ @param severity: Severity of distortion, [1, 5]
+ @return: Degraded image, H x W x 3, value range [0, 255]
+ """
+ c = [2.0, 3.0, 5.0, 8.0, 16.0][severity - 1]
+ ycrcb = np.array(cv2.cvtColor(img, cv2.COLOR_RGB2YCR_CB), dtype=np.float32)
+ ycrcb[:, :, 1] = 128 + (ycrcb[:, :, 1] - 128) * c
+ ycrcb[:, :, 2] = 128 + (ycrcb[:, :, 2] - 128) * c
+ ycrcb = np.uint8(np.clip(ycrcb, 0, 255))
+ img = cv2.cvtColor(ycrcb, cv2.COLOR_YCR_CB2RGB)
+ return img
diff --git a/data/degradation_toolkit/x_distortion/spatter.py b/data/degradation_toolkit/x_distortion/spatter.py
new file mode 100644
index 0000000000000000000000000000000000000000..9f78472a674cb69bdcea970ba678cf083a2e93c0
--- /dev/null
+++ b/data/degradation_toolkit/x_distortion/spatter.py
@@ -0,0 +1,74 @@
+import cv2
+import numpy as np
+from skimage.filters import gaussian
+
+def rgb2gray(rgb):
+ return np.dot(rgb[..., :3], [0.2989, 0.5870, 0.1140])
+
+def spatter(x, severity=1):
+ c = [(0.65, 0.3, 4, 0.69, 0.6, 0),
+ (0.65, 0.3, 3, 0.68, 0.6, 0),
+ (0.65, 0.3, 2, 0.68, 0.5, 0),
+ (0.65, 0.3, 1, 0.65, 1.5, 1),
+ (0.67, 0.4, 1, 0.65, 1.5, 1)][severity - 1]
+ x_PIL = x
+ x = np.array(x, dtype=np.float32) / 255.
+
+ liquid_layer = np.random.normal(size=x.shape[:2], loc=c[0], scale=c[1])
+
+ liquid_layer = gaussian(liquid_layer, sigma=c[2])
+ liquid_layer[liquid_layer < c[3]] = 0
+ if c[5] == 0:
+ liquid_layer = (liquid_layer * 255).astype(np.uint8)
+ dist = 255 - cv2.Canny(liquid_layer, 50, 150)
+ dist = cv2.distanceTransform(dist, cv2.DIST_L2, 5)
+ _, dist = cv2.threshold(dist, 20, 20, cv2.THRESH_TRUNC)
+ dist = cv2.blur(dist, (3, 3)).astype(np.uint8)
+ dist = cv2.equalizeHist(dist)
+ ker = np.array([[-2, -1, 0], [-1, 1, 1], [0, 1, 2]])
+ dist = cv2.filter2D(dist, cv2.CV_8U, ker)
+ dist = cv2.blur(dist, (3, 3)).astype(np.float32)
+
+ m = cv2.cvtColor(liquid_layer * dist, cv2.COLOR_GRAY2BGRA)
+ m /= np.max(m, axis=(0, 1))
+ m *= c[4]
+ # water is pale turqouise
+ color = np.concatenate((175 / 255. * np.ones_like(m[..., :1]),
+ 238 / 255. * np.ones_like(m[..., :1]),
+ 238 / 255. * np.ones_like(m[..., :1])), axis=2)
+
+ color = cv2.cvtColor(color, cv2.COLOR_BGR2BGRA)
+
+ if len(x.shape) < 3 or x.shape[2] < 3:
+ add_spatter_color = cv2.cvtColor(np.clip(m * color, 0, 1),
+ cv2.COLOR_BGRA2BGR)
+ add_spatter_gray = rgb2gray(add_spatter_color)
+
+ return np.clip(x + add_spatter_gray, 0, 1) * 255
+
+ else:
+
+ x = cv2.cvtColor(x, cv2.COLOR_BGR2BGRA)
+
+ return cv2.cvtColor(np.clip(x + m * color, 0, 1),
+ cv2.COLOR_BGRA2BGR) * 255
+ else:
+ m = np.where(liquid_layer > c[3], 1, 0)
+ m = gaussian(m.astype(np.float32), sigma=c[4])
+ m[m < 0.8] = 0
+
+ x_rgb = np.array(x_PIL.convert('RGB'))
+
+ # mud brown
+ color = np.concatenate((63 / 255. * np.ones_like(x_rgb[..., :1]),
+ 42 / 255. * np.ones_like(x_rgb[..., :1]),
+ 20 / 255. * np.ones_like(x_rgb[..., :1])),
+ axis=2)
+ color *= m[..., np.newaxis]
+ if len(x.shape) < 3 or x.shape[2] < 3:
+ x *= (1 - m)
+ return np.clip(x + rgb2gray(color), 0, 1) * 255
+
+ else:
+ x *= (1 - m[..., np.newaxis])
+ return np.clip(x + color, 0, 1) * 255
\ No newline at end of file
diff --git a/imgproc.py b/data/imgproc.py
similarity index 100%
rename from imgproc.py
rename to data/imgproc.py
diff --git a/demo_tasks/gradio_tasks_relighting.py b/demo_tasks/gradio_tasks_relighting.py
deleted file mode 100644
index 067f44623512e0df797b16a9c60bc4fe20a722a0..0000000000000000000000000000000000000000
--- a/demo_tasks/gradio_tasks_relighting.py
+++ /dev/null
@@ -1,239 +0,0 @@
-import os
-from data.prefix_instruction import get_image_prompt, get_task_instruction, get_layout_instruction, get_content_instruction
-import random
-from PIL import Image
-
-
-task_instruction = "Each row shows a process to manipulate the illumination of images and changes the background following the instruction."
-content_instruction = "In the last row, the illumination comes from left side of the image, with changed background and style as "
-relighting = [
- dict(
- name='sunset over sea',
- images=[
- os.path.join('demo_tasks/examples/relighting/02daa50ac59bb9eabcbe0d5304af880d941bffc3.jpg'),
- os.path.join('demo_tasks/examples/relighting/02daa50ac59bb9eabcbe0d5304af880d941bffc3_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02db8a5f38464943d496bd3b475c36a3d65e7095.jpg'),
- os.path.join('demo_tasks/examples/relighting/02db8a5f38464943d496bd3b475c36a3d65e7095_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02db96d3ce2531dc4d51dda52492b78cf3577c56.jpg'),
- os.path.join('demo_tasks/examples/relighting/02db96d3ce2531dc4d51dda52492b78cf3577c56_Left.jpg'),
- ],
- grid_h=3,
- grid_w=2,
- task_prompt=task_instruction,
- content_prompt=content_instruction + "sunset over sea.",
- ),
- dict(
- name='light and shadow',
- images=[
- os.path.join('demo_tasks/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02db31cb32e74620523955b70807b3e11815451c.jpg'),
- os.path.join('demo_tasks/examples/relighting/02db31cb32e74620523955b70807b3e11815451c_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dcd82122ffe344c8d7c289dc770febb5121153.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dcd82122ffe344c8d7c289dc770febb5121153_Left.jpg'),
- ],
- grid_h=3,
- grid_w=2,
- task_prompt=task_instruction,
- content_prompt=content_instruction + "light and shadow.",
- ),
- dict(
- name='sci-fi RGB glowing, cyberpunkw',
- images=[
- os.path.join('demo_tasks/examples/relighting/02db5a81c222483058fecd76d62c5f7246b06ee4.jpg'),
- os.path.join('demo_tasks/examples/relighting/02db5a81c222483058fecd76d62c5f7246b06ee4_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02db80670789cc6722f78747cf6ab8c292a898ab.jpg'),
- os.path.join('demo_tasks/examples/relighting/02db80670789cc6722f78747cf6ab8c292a898ab_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dc3e2cf9541a7d7ebff79cbf1fb0d95b4911e8.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dc3e2cf9541a7d7ebff79cbf1fb0d95b4911e8_Left.jpg'),
- ],
- grid_h=3,
- grid_w=2,
- task_prompt=task_instruction,
- content_prompt=content_instruction + "sci-fi RGB glowing, cyberpunk.",
- ),
- dict(
- name='golden time',
- images=[
- os.path.join('demo_tasks/examples/relighting/02dc6ca122863a582306a4f146b7bccb721a49e0.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dc6ca122863a582306a4f146b7bccb721a49e0_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dc4ebfd90dc80dbc0f4174679ff3828605ec9c.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dc4ebfd90dc80dbc0f4174679ff3828605ec9c_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dca7ccfad757fd596d33563d06b3ab7836d5af.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dca7ccfad757fd596d33563d06b3ab7836d5af_Left.jpg'),
- ],
- grid_h=3,
- grid_w=2,
- task_prompt=task_instruction,
- content_prompt=content_instruction + "golden time.",
- ),
- dict(
- name='shadow from window',
- images=[
- os.path.join('demo_tasks/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4_Left.jpg'),
- ],
- grid_h=3,
- grid_w=2,
- task_prompt=task_instruction,
- content_prompt=content_instruction + "shadow from window.",
- ),
- dict(
- name='soft studio lighting',
- images=[
- os.path.join('demo_tasks/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dd6a91d0d1d17a9f06e999654b541b555da242.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dd6a91d0d1d17a9f06e999654b541b555da242_Left.jpg'),
- ],
- grid_h=2,
- grid_w=2,
- task_prompt=task_instruction,
- content_prompt=content_instruction + "soft studio lighting.",
- ),
- dict(
- name='evil, gothic, Yharnam',
- images=[
- os.path.join('demo_tasks/examples/relighting/02aee2a8df8f6e6f16ca4ec278203543656cecf1.jpg'),
- os.path.join('demo_tasks/examples/relighting/02aee2a8df8f6e6f16ca4ec278203543656cecf1_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02af9925c86c22b379e4e6d4f2762d66966ee281.jpg'),
- os.path.join('demo_tasks/examples/relighting/02af9925c86c22b379e4e6d4f2762d66966ee281_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dd79a669a4522f1d5631d75c14243f927848b8.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dd79a669a4522f1d5631d75c14243f927848b8_Left.jpg'),
- ],
- grid_h=3,
- grid_w=2,
- task_prompt=task_instruction,
- content_prompt=content_instruction + "evil, gothic, Yharnam.",
- ),
- dict(
- name='neon, Wong Kar-wai, warm',
- images=[
- os.path.join('demo_tasks/examples/relighting/02af99b6765a77a8f2ac87aa42d2f2453dcd590f.jpg'),
- os.path.join('demo_tasks/examples/relighting/02af99b6765a77a8f2ac87aa42d2f2453dcd590f_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02b02e2916bf2eb3608f5a806dc3b7ecbed3b649.jpg'),
- os.path.join('demo_tasks/examples/relighting/02b02e2916bf2eb3608f5a806dc3b7ecbed3b649_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010.jpg'),
- os.path.join('demo_tasks/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010_Left.jpg'),
- ],
- grid_h=3,
- grid_w=2,
- task_prompt=task_instruction,
- content_prompt=content_instruction + "neon, Wong Kar-wai, warm.",
- ),
- dict(
- name='home atmosphere, cozy bedroom illumination',
- images=[
- os.path.join('demo_tasks/examples/relighting/02db22466eb3bc19d6a10195e1b48fff696c1582.jpg'),
- os.path.join('demo_tasks/examples/relighting/02db22466eb3bc19d6a10195e1b48fff696c1582_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02c3760bf08f00d9e2163248e2864f5e1a70d709.jpg'),
- os.path.join('demo_tasks/examples/relighting/02c3760bf08f00d9e2163248e2864f5e1a70d709_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02af06c41208b31248e94da13166a675c862b003.jpg'),
- os.path.join('demo_tasks/examples/relighting/02af06c41208b31248e94da13166a675c862b003_Left.jpg'),
- ],
- grid_h=3,
- grid_w=2,
- task_prompt=task_instruction,
- content_prompt=content_instruction + "home atmosphere, cozy bedroom illumination.",
- ),
- dict(
- name='warm atmosphere, at home, bedroom',
- images=[
- os.path.join('demo_tasks/examples/relighting/02c39e8e82f4be91d24252c8bfbfdef033ec8a32.jpg'),
- os.path.join('demo_tasks/examples/relighting/02c39e8e82f4be91d24252c8bfbfdef033ec8a32_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02c5200cac1d0f19256232a09708ac47f6ddfab3.jpg'),
- os.path.join('demo_tasks/examples/relighting/02c5200cac1d0f19256232a09708ac47f6ddfab3_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c_Left_2.jpg'),
- ],
- grid_h=3,
- grid_w=2,
- task_prompt=task_instruction,
- content_prompt=content_instruction + "warm atmosphere, at home, bedroom.",
- ),
- dict(
- name='natural lighting',
- images=[
- os.path.join('demo_tasks/examples/relighting/02dafead46f6d59172d8df216c1f5ad11f9899b5.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dafead46f6d59172d8df216c1f5ad11f9899b5_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dc42496c4ffdb2a8e101ed82943b26fc2d9d24.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dc42496c4ffdb2a8e101ed82943b26fc2d9d24_Left.jpg'),
- ],
- grid_h=2,
- grid_w=2,
- task_prompt=task_instruction,
- content_prompt=content_instruction + "natural lighting.",
- ),
- dict(
- name='magic lit',
- images=[
- os.path.join('demo_tasks/examples/relighting/02dd9913f85a62d9c1587b00f610cc753ebad649.jpg'),
- os.path.join('demo_tasks/examples/relighting/02dd9913f85a62d9c1587b00f610cc753ebad649_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02afbcf084a1e35bda34c26d2271d56b6a1c621e.jpg'),
- os.path.join('demo_tasks/examples/relighting/02afbcf084a1e35bda34c26d2271d56b6a1c621e_Left.jpg'),
- ],
- grid_h=2,
- grid_w=2,
- task_prompt=task_instruction,
- content_prompt=content_instruction + "magic lit.",
- ),
- dict(
- name='sunshine from window',
- images=[
- os.path.join('demo_tasks/examples/relighting/02c53f12ec3d4a9a16d9b0ca3f7773ad2222100c.jpg'),
- os.path.join('demo_tasks/examples/relighting/02c53f12ec3d4a9a16d9b0ca3f7773ad2222100c_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02c6c0f92a672110ff86bd12f4aa0d0083c9cf6b.jpg'),
- os.path.join('demo_tasks/examples/relighting/02c6c0f92a672110ff86bd12f4aa0d0083c9cf6b_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02c5cc03d46ce15494caaf3d65a2b2c7e09089f2.jpg'),
- os.path.join('demo_tasks/examples/relighting/02c5cc03d46ce15494caaf3d65a2b2c7e09089f2_Left.jpg'),
- ],
- grid_h=3,
- grid_w=2,
- task_prompt=task_instruction,
- content_prompt=content_instruction + "sunshine from window.",
- ),
- dict(
- name='neon light, city',
- images=[
- os.path.join('demo_tasks/examples/relighting/02c7df6c0decd3d542e25089a0af6afe1e070b6a.jpg'),
- os.path.join('demo_tasks/examples/relighting/02c7df6c0decd3d542e25089a0af6afe1e070b6a_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02c77b643fbdaec82912634655426553f3d7a537.jpg'),
- os.path.join('demo_tasks/examples/relighting/02c77b643fbdaec82912634655426553f3d7a537_Left.jpg'),
- os.path.join('demo_tasks/examples/relighting/02c73157a981e0ee669ca8125018efbdda1e1483.jpg'),
- os.path.join('demo_tasks/examples/relighting/02c73157a981e0ee669ca8125018efbdda1e1483_Left.jpg'),
- ],
- grid_h=3,
- grid_w=2,
- task_prompt=task_instruction,
- content_prompt=content_instruction + "neon light, city.",
- ),
-]
-relighting_text = [[x['name']] for x in relighting]
-
-
-def process_relighting_tasks(x):
- for task in relighting:
- if task['name'] == x[0]:
- task_prompt = task['task_prompt']
- content_prompt = task['content_prompt']
-
- images = task['images']
- rets = []
- for image in images:
- rets.append(Image.open(image))
-
- grid_h = task['grid_h']
- grid_w = task['grid_w']
- mask = task.get('mask', [0 for _ in range(grid_w - 1)] + [1])
- layout_prompt = get_layout_instruction(grid_w, grid_h)
-
- upsampling_noise = 0.6
- steps = 30
- outputs = [mask, grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps] + rets
- break
-
- return outputs
diff --git a/examples/__init__.py b/examples/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..7236bf0992c5c11d8d8679719e3bffb9d0595023
--- /dev/null
+++ b/examples/__init__.py
@@ -0,0 +1,13 @@
+from .gradio_tasks import dense_prediction_text, conditional_generation_text, process_dense_prediction_tasks, process_conditional_generation_tasks
+from .gradio_tasks_restoration import image_restoration_text, process_image_restoration_tasks
+from .gradio_tasks_style import style_transfer_text, style_condition_fusion_text, process_style_transfer_tasks, process_style_condition_fusion_tasks
+from .gradio_tasks_tryon import tryon_text, process_tryon_tasks
+from .gradio_tasks_editing import editing_text, process_editing_tasks
+from .gradio_tasks_photodoodle import photodoodle_text, process_photodoodle_tasks
+from .gradio_tasks_editing_subject import editing_with_subject_text, process_editing_with_subject_tasks
+from .gradio_tasks_relighting import relighting_text, process_relighting_tasks
+from .gradio_tasks_unseen import unseen_tasks_text, process_unseen_tasks
+from .gradio_tasks_subject import subject_driven_text, condition_subject_fusion_text, condition_subject_style_fusion_text, style_transfer_with_subject_text, \
+ image_restoration_with_subject_text, \
+ process_subject_driven_tasks, process_image_restoration_with_subject_tasks, process_style_transfer_with_subject_tasks, process_condition_subject_style_fusion_tasks, \
+ process_condition_subject_fusion_tasks
\ No newline at end of file
diff --git a/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9.jpg b/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..0dd17034dd5d1d649ea79cd78f608deb58724b29
--- /dev/null
+++ b/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e0c4bde1a615edc572ce74f5e334c7cd035f686bf94d00fa13de1c825a837010
+size 227638
diff --git a/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_ben2-background-removal.jpg b/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_ben2-background-removal.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..72aa89095606ebbe2ed48cae3d4dee654c1bb4c5
--- /dev/null
+++ b/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_ben2-background-removal.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:59ecf637fce4eb98d75a9f17f005887b62fcf4f25db258a0e3f39f93a0704014
+size 47062
diff --git a/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_canny_100_200_512.jpg b/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..6df7f05d2e15698eff3a404bb650aa3628aad2de
--- /dev/null
+++ b/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a78563977bc2236d93bff7a2e1459efcb737eabe5e044c70ce627840796106e9
+size 183790
diff --git a/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_depth-anything-v2_Large.jpg b/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..370a23536bfe51a1fc5b1bc7e31efefe87ad4990
--- /dev/null
+++ b/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:944b88ce7c555db6653fab381d475d7af2d5552dd732c9fe3b81c28a9aa6b425
+size 80719
diff --git a/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_dsine_normal_map.jpg b/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_dsine_normal_map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..acfd3c0b3717208df4321db141000673e6c3a319
--- /dev/null
+++ b/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_dsine_normal_map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:107b1cfe736e79078760fbbeffa050e82584e4265eb632948107926a2e0b1ed3
+size 142596
diff --git a/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_hed_512.jpg b/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..4bb8e5e7cf871177a41df077b3e944254a581c53
--- /dev/null
+++ b/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7db142dd0065491bc4c8367cd1b5c7fbaaa754eafed5ab80a9980d43c6c5a326
+size 164556
diff --git a/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_sam2_mask.jpg b/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_sam2_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..c316375669aea2db2306017971e7dc26b70d4f1f
--- /dev/null
+++ b/examples/examples/012cd3921e1f97d761eeff580f918ff9/012cd3921e1f97d761eeff580f918ff9_sam2_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c2439f48bf3a32e2e380c6c73016d63660a6a36cc8fbeeb3737c8b92c9ca3a07
+size 228612
diff --git a/examples/examples/0fdaecdb7906a1bf0d6e202363f15de3/0fdaecdb7906a1bf0d6e202363f15de3.jpg b/examples/examples/0fdaecdb7906a1bf0d6e202363f15de3/0fdaecdb7906a1bf0d6e202363f15de3.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a0ca26d2effaaac040357f340ed334b6e3882c70
--- /dev/null
+++ b/examples/examples/0fdaecdb7906a1bf0d6e202363f15de3/0fdaecdb7906a1bf0d6e202363f15de3.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:59350c813475dce227e740d946c5b7664c4390c6d26f3261ec0202a2480c5b74
+size 242999
diff --git a/examples/examples/0fdaecdb7906a1bf0d6e202363f15de3/0fdaecdb7906a1bf0d6e202363f15de3_instantx-style_0.jpg b/examples/examples/0fdaecdb7906a1bf0d6e202363f15de3/0fdaecdb7906a1bf0d6e202363f15de3_instantx-style_0.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..0823e4038cff94e17cdadb4cdad6e924fe8e0d56
--- /dev/null
+++ b/examples/examples/0fdaecdb7906a1bf0d6e202363f15de3/0fdaecdb7906a1bf0d6e202363f15de3_instantx-style_0.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:19c642b67133efe536ee9a7cf9016e7f269db2d23c2bea9a077e83460cd7d629
+size 248980
diff --git a/examples/examples/0fdaecdb7906a1bf0d6e202363f15de3/0fdaecdb7906a1bf0d6e202363f15de3_instantx-style_0_style.jpg b/examples/examples/0fdaecdb7906a1bf0d6e202363f15de3/0fdaecdb7906a1bf0d6e202363f15de3_instantx-style_0_style.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a4569eb8a7cac27f7f729553e2fd205105216ccb
--- /dev/null
+++ b/examples/examples/0fdaecdb7906a1bf0d6e202363f15de3/0fdaecdb7906a1bf0d6e202363f15de3_instantx-style_0_style.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0796121fe4d6a689278cf5af4f0428793b38c3ce9d5c39072a45a3c6a0dfe21e
+size 342364
diff --git a/examples/examples/0fdaecdb7906a1bf0d6e202363f15de3/0fdaecdb7906a1bf0d6e202363f15de3_qwen2_5_mask.jpg b/examples/examples/0fdaecdb7906a1bf0d6e202363f15de3/0fdaecdb7906a1bf0d6e202363f15de3_qwen2_5_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..22e42d3d278efea2f564797217e860502a5a47d3
--- /dev/null
+++ b/examples/examples/0fdaecdb7906a1bf0d6e202363f15de3/0fdaecdb7906a1bf0d6e202363f15de3_qwen2_5_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:85dc6eb30251a4c7bb45d6a8caea4f9d93f40543dfb4ad6d50d647ab49a15bee
+size 65937
diff --git a/examples/examples/10d7dcae5240b8cc8c9427e876b4f462/10d7dcae5240b8cc8c9427e876b4f462.jpg b/examples/examples/10d7dcae5240b8cc8c9427e876b4f462/10d7dcae5240b8cc8c9427e876b4f462.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..94564b9558a0d02c39d30a5982959d704117b63d
--- /dev/null
+++ b/examples/examples/10d7dcae5240b8cc8c9427e876b4f462/10d7dcae5240b8cc8c9427e876b4f462.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:156bcd9d1123e6732829ccca11eda8761191f219de538e5b1746c9d283c47627
+size 216488
diff --git a/examples/examples/10d7dcae5240b8cc8c9427e876b4f462/10d7dcae5240b8cc8c9427e876b4f462_instantx-style_0.jpg b/examples/examples/10d7dcae5240b8cc8c9427e876b4f462/10d7dcae5240b8cc8c9427e876b4f462_instantx-style_0.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..e206deb9bf6cd248bab0677b2d67cd7c69f59ca9
--- /dev/null
+++ b/examples/examples/10d7dcae5240b8cc8c9427e876b4f462/10d7dcae5240b8cc8c9427e876b4f462_instantx-style_0.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4c9beac8a2d2713b06311394315c006192a1ea35f17ee80e8fc4d6f6a93464b4
+size 381724
diff --git a/examples/examples/10d7dcae5240b8cc8c9427e876b4f462/10d7dcae5240b8cc8c9427e876b4f462_instantx-style_0_style.jpg b/examples/examples/10d7dcae5240b8cc8c9427e876b4f462/10d7dcae5240b8cc8c9427e876b4f462_instantx-style_0_style.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..9e2007d6721129c6ef0bd13f7b76b9f68b7e9050
--- /dev/null
+++ b/examples/examples/10d7dcae5240b8cc8c9427e876b4f462/10d7dcae5240b8cc8c9427e876b4f462_instantx-style_0_style.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f91bd76cd88742f32d48f659d7e1890e5f6c7986f542b4a4b5041d9aa4cd6e23
+size 457896
diff --git a/examples/examples/10d7dcae5240b8cc8c9427e876b4f462/10d7dcae5240b8cc8c9427e876b4f462_qwen2_5_mask.jpg b/examples/examples/10d7dcae5240b8cc8c9427e876b4f462/10d7dcae5240b8cc8c9427e876b4f462_qwen2_5_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..bd61ee1a03a9374ffcfe1a9a329a6b36fec97c83
--- /dev/null
+++ b/examples/examples/10d7dcae5240b8cc8c9427e876b4f462/10d7dcae5240b8cc8c9427e876b4f462_qwen2_5_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:538a5a535aad2befabcdb23914d8e4bf2dd00aedc0ec7f460742ce3a2d3ebb44
+size 52964
diff --git a/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3.jpg b/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..0115146fba654c27fe2b9122659bcd042962aafa
--- /dev/null
+++ b/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e92c8ccfb16feac9a6ebb408c459cacb1480984b1f2069939834e1e22f342f82
+size 223838
diff --git a/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_canny_100_200_512.jpg b/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..0280cd77e6416837735ebcd4bcdc53382ba219fd
--- /dev/null
+++ b/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:680ad5e599de63a1cdcf11fb52c81688c26ee1a49664940388b6526a01bce4ba
+size 227372
diff --git a/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_depth-anything-v2_Large.jpg b/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..73d76ac4be7d7935f7901de42aff49f1bf127400
--- /dev/null
+++ b/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a85966b4f60297e0b4c4cf50d1a5052589f4a56b12683aefaa508101fb0f1b75
+size 72591
diff --git a/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_dsine_normal_map.jpg b/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_dsine_normal_map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..21521b3ed4209be8128c1f31d52b6856f8bb4d8b
--- /dev/null
+++ b/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_dsine_normal_map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2bcd73f41f18c76353aedea03130566b5fa7e63ac11e429eaa2a1e6469f8192c
+size 229654
diff --git a/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_hed_512.jpg b/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..aabf5206a988174de4ffe54ae0097dec0b2a2e6f
--- /dev/null
+++ b/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ac807b0fa0c1dfd41fc8b4b0a20d5cd74eb414f53020d6471dabb269b6f67303
+size 169728
diff --git a/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_openpose_fullres_nohand.jpg b/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_openpose_fullres_nohand.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..eb9a1c685a3cfcd5e1425240133a919570d4d7a2
--- /dev/null
+++ b/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_openpose_fullres_nohand.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0dd5fa3b2ee1b2d71603a266f3b45b2f9e3bfe2be5ee9279d3ba98d0dc6b8231
+size 127109
diff --git a/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_sam2_mask.jpg b/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_sam2_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..fac83d2f29859a7a476a746f7a2ad6561801fede
--- /dev/null
+++ b/examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_sam2_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c2729c28b7c2aad173ec15eb1c6426578aabbe3048f8fff4e7c138ed33c89934
+size 209035
diff --git a/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de.jpg b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..6b23171c2ddc4bbef89d3d14676bf8b65781a10d
--- /dev/null
+++ b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:42873e75c6fdb61555e708ac840b976d3eef4b75459529f122540eae7108112f
+size 248522
diff --git a/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_ben2-background-removal.jpg b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_ben2-background-removal.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..85e4706a64eaf775c71df4376602f7729bcd25ef
--- /dev/null
+++ b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_ben2-background-removal.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b87c1ac807916d1487bb862f15066d209a7500ef24077e11e922d7056f5e8f0b
+size 35078
diff --git a/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_canny_100_200_512.jpg b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..0759c4fb3454398b8efae1aa3121db2890109f37
--- /dev/null
+++ b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:366435caadac2827ecca13babdf330af9325d17e315afa120237b3c74b7c72e0
+size 245504
diff --git a/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_depth-anything-v2_Large.jpg b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..03c8872fac84537822ed79a8209b2774c459909d
--- /dev/null
+++ b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ce6a51be1be204fc34c6d7414eee8b90ddfd34799fe864c1ae5de2f0e2e378ad
+size 109603
diff --git a/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_dsine_normal_map.jpg b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_dsine_normal_map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..4fbdeaa7ba301b9b7eab4b76e9bed471b217402d
--- /dev/null
+++ b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_dsine_normal_map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e00b81024e0095b1fd11e765baaf54f2aeb7d60dcee231a21e51ccf6a4e712fa
+size 121473
diff --git a/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_hed_512.jpg b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..917934b90340e7d9d3446769ac8ce96a1bb2abba
--- /dev/null
+++ b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:05608dc817cae352ba734afe41950313b916ba3806d0b80b5b66a86ab9315ec8
+size 184158
diff --git a/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_instantx-style_0.jpg b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_instantx-style_0.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..e51b81e86290c5010e92b0f5e153e7db3a5aa557
--- /dev/null
+++ b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_instantx-style_0.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:436202fa1183d1fbca5cd509b6103519d0813140ea52a3aa679517e564edfde0
+size 317914
diff --git a/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_instantx-style_0_style.jpg b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_instantx-style_0_style.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..5a466fe6f7a9376fcd1e28201bd75e4f582ae825
--- /dev/null
+++ b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_instantx-style_0_style.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ff1c102fb5f471398e8d53b7b9e737ab0c436c70b7c246495d8c49e5d8f2a6ea
+size 373789
diff --git a/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_sam2_mask.jpg b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_sam2_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a3e6919b3e7c25c785af2dffac6e481dacd8ae58
--- /dev/null
+++ b/examples/examples/2c4e256fa512cb7e7f433f4c7f9101de/2c4e256fa512cb7e7f433f4c7f9101de_sam2_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3cc574c8c405b96421ded317616a67191c18a2a90531cc1dc1d4561a7579e622
+size 302800
diff --git a/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a.jpg b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..816ffe9a9f3d2a7212ac846e3cdb9499950bff1b
--- /dev/null
+++ b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9e42a74f10495af6f0716b18b1089be5c46d7ad6f3a0cd6cf73c6387521b632f
+size 263697
diff --git a/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_ben2-background-removal.jpg b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_ben2-background-removal.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..9d1d4c9ba460ee6c46e533284e870ba45e62047e
--- /dev/null
+++ b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_ben2-background-removal.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:076b846470741ad620f883a66f4d3e2d7681aa110e2add517ab9744932bfe33a
+size 32031
diff --git a/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_canny_100_200_512.jpg b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..00b194378bf601a2c9cecea7e6129cb982d53043
--- /dev/null
+++ b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ac8a3c1e379e6130f1eaebbfeda9a2640800b0dfa439b247c9cad941f91212e1
+size 262489
diff --git a/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_depth-anything-v2_Large.jpg b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..ba5f5dd0e99769fa9d74a9b6d5b95e1e39bf9d01
--- /dev/null
+++ b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c239c35085d26208ce27874d22bb98d33067be1ba8ffc154ba77d8111de90361
+size 83448
diff --git a/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_dsine_normal_map.jpg b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_dsine_normal_map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..b02d288856268864938cec12a001dff3425edb11
--- /dev/null
+++ b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_dsine_normal_map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b78e869218a4cc86a4a86402546e56d332abc700f8a9f11569ee845fcba047b2
+size 75378
diff --git a/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_hed_512.jpg b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..e9c6144a4407147b5bdad8064c8d2c1a39458ee3
--- /dev/null
+++ b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d45e4d1049902e0338a2e3f655829eacbdcdebe06ed74c9cf36f6959648ef7b8
+size 173472
diff --git a/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_instantx-style_0.jpg b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_instantx-style_0.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..08ecb5a6a72f2f859a5bd05fb1c87a72e1627f18
--- /dev/null
+++ b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_instantx-style_0.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7f720e8a35a3e88fdf4bb397101273a1fa1b04e3dc0c01847968f73de7f182f7
+size 403122
diff --git a/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_instantx-style_0_style.jpg b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_instantx-style_0_style.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a09b37e91e21be8ddd769e514198a28ba9471aeb
--- /dev/null
+++ b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_instantx-style_0_style.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ed11c2cdd9ff5f80502c77f3f569c9a76b51dd6f09709ff944021ac9efdb645b
+size 315105
diff --git a/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_sam2_mask.jpg b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_sam2_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..9daf63186d4d269d3a515ed0d272793c739efa8e
--- /dev/null
+++ b/examples/examples/53b3f413257bee9e499b823b44623b1a/53b3f413257bee9e499b823b44623b1a_sam2_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:261928e1dc45c5f6a4caefcd4f6c454c31cb4a5e3664ffb7530643b16445319c
+size 239491
diff --git a/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e.jpg b/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..acb59dd1a23a6b7edff23b6aba21c6399c1f36d9
--- /dev/null
+++ b/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a38c8399d75a03a4698fbba6f679bfd254e0b395e4b29c5fa910e456360f9a1e
+size 209913
diff --git a/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e_ben2-background-removal.jpg b/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e_ben2-background-removal.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..8766a5648ebc32c565fc7bcb85692b8a706407f0
--- /dev/null
+++ b/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e_ben2-background-removal.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2346b5c8cc01cf5ab4292b86cea5a446688ac12139c84edafd0183e02787ea2e
+size 32599
diff --git a/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e_canny_100_200_512.jpg b/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..b83ce2dcad0657597f3e37368c2bf952316fea58
--- /dev/null
+++ b/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0b91a98bdd10227ef531fb8a923be12d5e7221e8cb8acfbf0adf01148b6af9d0
+size 177410
diff --git a/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e_depth-anything-v2_Large.jpg b/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..2ade7df1e5d9190a07cad35160bfa366d26a916d
--- /dev/null
+++ b/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:aeafc34894e7e50bf7cae926acfee4a43c7156f857132f359d58b50ceadba267
+size 67737
diff --git a/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e_dsine_normal_map.jpg b/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e_dsine_normal_map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..9b2b880c424822b970c60ba6b4b5d4332704b9cc
--- /dev/null
+++ b/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e_dsine_normal_map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9a21efb8f5f8fe2dde3977d0dd07c2aef1d442097274bebb4f280a5772df0366
+size 87735
diff --git a/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e_hed_512.jpg b/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..390df27a0cc0fccf19234edb36a9688457b8aed2
--- /dev/null
+++ b/examples/examples/5bf755ed9dbb9b3e223e7ba35232b06e/5bf755ed9dbb9b3e223e7ba35232b06e_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d2e3016bda8b30e2c5bd134eca39a0d66c810f51e5ff578721a55088f342d486
+size 142922
diff --git a/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a.jpg b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..1c65f200b78660cd5d9e71d9139b39c15503923f
--- /dev/null
+++ b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d6b740124d507fb4ff452c4d6c73120a104851a5e30e9380cf8fc34fdad799b7
+size 308600
diff --git a/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_ben2-background-removal.jpg b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_ben2-background-removal.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..e9f3db1cf3bbb95784c40af2f755869a4b181daf
--- /dev/null
+++ b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_ben2-background-removal.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8bdae801bacabd7f889af7d7d3659cdbff563edd315df4cbcc4124f72e8db597
+size 81800
diff --git a/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_canny_100_200_512.jpg b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..65eb192bcff972ae70d8d8d333c6e6a160a647a3
--- /dev/null
+++ b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8ccd3b793e21c462687fd97d172e59682c69de85d21e31517a610939297ffeae
+size 295100
diff --git a/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_depth-anything-v2_Large.jpg b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..ff6940c1ef88ca4f7bc69e427f34b98a625239cf
--- /dev/null
+++ b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d4ecc8e0a5e8b59b276517b33b25d6a5a700e5a1a26f39f2533625235d85d6f9
+size 98671
diff --git a/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_dsine_normal_map.jpg b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_dsine_normal_map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..5be5837c6aeef0b260c4cdb07aae52a9621ed210
--- /dev/null
+++ b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_dsine_normal_map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4b9bc882b8388273ac5ba81d612f09a72765b4de1065831b9c0089910518c5ac
+size 192377
diff --git a/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_edge.jpg b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_edge.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..cf5b28a411311ecd7105e6bbb1a64b23f5fd4d96
--- /dev/null
+++ b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_edge.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:af53852dfbefc94a46fa364ef1320a43aebda86729f53b17ccd8796025a43322
+size 7850
diff --git a/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_hed_512.jpg b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..727d6067861df273dbfb6fb355304c8e1a63cd8f
--- /dev/null
+++ b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c7394212b80816d1b2c54f10354dfa2407f7ffdfdfb500a98168f7f302713869
+size 195830
diff --git a/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_instantx-style_0.jpg b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_instantx-style_0.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..0345483effa6dad261cac526a9addd7c3d2387dc
--- /dev/null
+++ b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_instantx-style_0.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d7b31a38a63be4f27acd71942d107b85ac99ee140097a96f1744f3fa31f85551
+size 320901
diff --git a/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_instantx-style_0_style.jpg b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_instantx-style_0_style.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..6dff8dc0eac49c7dc37efe5ccc033b7b99181124
--- /dev/null
+++ b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_instantx-style_0_style.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:abfeb146d90c7bd977a51c8dab40a63025cf49f4931416f18c91d53c3cf51f9f
+size 701226
diff --git a/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_openpose_fullres_nohand.jpg b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_openpose_fullres_nohand.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..ceff1b0c1cc76cf5f529e037e9bc7f818008abbe
--- /dev/null
+++ b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_openpose_fullres_nohand.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:51d3f86764b65ccbb49e81e79be22e09d3369eee050b9fc0a499bd2d79c35ee1
+size 45379
diff --git a/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_sam2_mask.jpg b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_sam2_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..5872d8c1449a16b61d1714d40526181c271e302d
--- /dev/null
+++ b/examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_sam2_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:907e0b18d1ace3d4031641f123260054bb5846554730566261787b11050c11db
+size 265876
diff --git a/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b.jpg b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..4bc48a41f7f8541de35fea68d66d7dbc1fc9f5d4
--- /dev/null
+++ b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:92ae5cd151a2f482a52ec1731a48d0b48bbc75b205184ce55d8b34ed7b739e1a
+size 272751
diff --git a/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_ben2-background-removal.jpg b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_ben2-background-removal.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..95301496a97972a6154b302b3a4e1917814888fa
--- /dev/null
+++ b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_ben2-background-removal.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1af5c9f233653f460ed97e536e2ab3b173dee6ebfe28058c4050f413dfbbb616
+size 46404
diff --git a/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_canny_100_200_512.jpg b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..e284c2c870028f379e610ae39b175abaad9e9636
--- /dev/null
+++ b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e3131cc80e0058a7ef5dd4238fc6883069f4099f94db46aa39b48a2045a486fd
+size 275151
diff --git a/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_depth-anything-v2_Large.jpg b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..8ca7425a74219f14c6329eb86d59a8fff323c3a0
--- /dev/null
+++ b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1e210df7b4c7a0eb599c80ed0d22b546f8c966878e8821880a85390bd7eed64a
+size 83798
diff --git a/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_dsine_normal_map.jpg b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_dsine_normal_map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..cfe0a05c51ddd87d14013de0ffc2c36b3e48472f
--- /dev/null
+++ b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_dsine_normal_map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:736bb78480b5b0e8b936647018988be5bfc131ee6e1e545f02e68ee0fadeef6d
+size 225016
diff --git a/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_hed_512.jpg b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..9bb80a4ac4900030ecdddfd0b54624095bb7bb28
--- /dev/null
+++ b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d737e3aec8b6580a29d85c2cc3e5629946ee43455767fdd7236cd9af623a6b20
+size 190624
diff --git a/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_instantx-style_0.jpg b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_instantx-style_0.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..e26ea3c1add6c7995a8757c7f230b2d1aec55dbc
--- /dev/null
+++ b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_instantx-style_0.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:372d13551b6bbacc482a6e0a3ab5da7afe76648ff5a51743f8d3a7a3af83637a
+size 324699
diff --git a/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_instantx-style_0_style.jpg b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_instantx-style_0_style.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..66f82eef599f74b0bcf1b6b597e0a5b0a74f19fb
--- /dev/null
+++ b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_instantx-style_0_style.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:473119ca742e0a9e1a8c6c26d777ea8221518b6676803987578c23ee73021a79
+size 145360
diff --git a/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_sam2_mask.jpg b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_sam2_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a08f2c9062ce9d5ada542daac5877f51062bd9fb
--- /dev/null
+++ b/examples/examples/79f2ee632f1be3ad64210a641c4e201b/79f2ee632f1be3ad64210a641c4e201b_sam2_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:16613544849ee04d774505f473967f8952ecacfa59e9a46980b7b637db5760a6
+size 274289
diff --git a/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4.jpg b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..3231aae4b37213772bd3d077d97f1a12ab9be555
--- /dev/null
+++ b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3f6b57fb3d598db0bd725e4ba148e6e0ed08723e527fcfb27ff9d374e8cd859d
+size 165021
diff --git a/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_ben2-background-removal.jpg b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_ben2-background-removal.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..34721fa882ee601a23d11d1d624ac81fcae8e2ed
--- /dev/null
+++ b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_ben2-background-removal.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c53012fe2b8d0374e18bb9c849a9aa9d4d4579b5c9508ad4f4382001847518e0
+size 39155
diff --git a/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_canny_100_200_512.jpg b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..1c90245d261f121b10d2bc462a3a649a78c17c9f
--- /dev/null
+++ b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5477f21c3ab5f23716dcfd57ef30911bc1fdd429ebda3072e84b7a910e05592c
+size 99929
diff --git a/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_depth-anything-v2_Large.jpg b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..cb908c92ff47589e29de6af3e5f30efa887fa731
--- /dev/null
+++ b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a0f2cdd4efa4a948422add8aa69b1f54e67b2c7e5e3aaea54aeaf903678d3604
+size 62100
diff --git a/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_dsine_normal_map.jpg b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_dsine_normal_map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..f68c348ea8411a9781c80f271f6ea062eebfa596
--- /dev/null
+++ b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_dsine_normal_map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2b777efd4b430df8cbda366030b5b67558cb875653227cd633aad7a6a779e818
+size 85061
diff --git a/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_hed_512.jpg b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..7f52b4d384db3efd864c3f1cff590129d89eaa95
--- /dev/null
+++ b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:541999375fc5f70dcc55155f12b59672852bb4f9da104dc884de6834bf13418d
+size 105498
diff --git a/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_instantx-style_0.jpg b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_instantx-style_0.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..08b48bc00e9a6a5aff85fa656a81e837a9c4094e
--- /dev/null
+++ b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_instantx-style_0.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6d5519893973ec67612e5a0867562ebb37c15f7c25b3d20fdd2382d7d6787b22
+size 293789
diff --git a/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_instantx-style_0_style.jpg b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_instantx-style_0_style.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..5e537d8cb5e24f643180c67f03436693fb1f121c
--- /dev/null
+++ b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_instantx-style_0_style.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1fcd503a9da5bb7d2fe68fcd2d733be5c93de67d278455a8716c6a7c19a8caba
+size 68688
diff --git a/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_openpose_fullres_nohand.jpg b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_openpose_fullres_nohand.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..8d34ba8877eb6269217dda0998a71414e46b2664
--- /dev/null
+++ b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_openpose_fullres_nohand.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f8f984f536c030c515cedde83deee9ebf478c90be606aec1bfe0f548df6575f1
+size 41020
diff --git a/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_sam2_mask.jpg b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_sam2_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..83bda146b00d4b5e6c29068fc86a01216535c3e1
--- /dev/null
+++ b/examples/examples/88d0ba30e2c0bc4401cf2633cac162d4/88d0ba30e2c0bc4401cf2633cac162d4_sam2_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:93548ce0f3e80cbfdb24c05f43ee63159a922eefb7d8ef7ea698bf6dc71ad890
+size 136879
diff --git a/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2.jpg b/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..adf7e976a0b278a9abe2cfabd2de02f089d48932
--- /dev/null
+++ b/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9dd4947e63c05271bd4bca9d9259d3a9adb6f3705799b31589b65872a9cbd63e
+size 254902
diff --git a/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_ben2-background-removal.jpg b/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_ben2-background-removal.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..2d7fb11e61515076d77039cdf6216022da3a07c5
--- /dev/null
+++ b/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_ben2-background-removal.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ab395421a97a9c84fb9120e24c43e2c5aede02fa17c43c1e33eb3517471afcb2
+size 49523
diff --git a/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_canny_100_200_512.jpg b/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..398a17026c4feee06d421341115fe5c26b238ebc
--- /dev/null
+++ b/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f12a310fcdf43e449b5d6712d89cf11cc70aa36a3f293aaa73e37e445ce45146
+size 248401
diff --git a/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_depth-anything-v2_Large.jpg b/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..d9ef96667a345ef4235305f6058f1537e98c50f7
--- /dev/null
+++ b/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2f09453bbf5c2ab1095f718a284c1773394f3b6714bc684cf81f8ae2e5e061c7
+size 80664
diff --git a/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_dsine_normal_map.jpg b/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_dsine_normal_map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..77532544445ee3fd7def1c5be86d71eabaf4cecd
--- /dev/null
+++ b/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_dsine_normal_map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dc33bb5cc1642894cdedbcf3849d415407b033c2299ce6148217a584cee7d210
+size 221129
diff --git a/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_hed_512.jpg b/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..7e30ca993f476a15e5ac79728f959fc9c23fba9e
--- /dev/null
+++ b/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c80af49bd7c5bc3c6a0331ebd99c364315d14bce342389108179107b700ee3b6
+size 201980
diff --git a/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_openpose_fullres_nohand.jpg b/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_openpose_fullres_nohand.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..533df14058c3c4218f4e90628cd0c0e623b59ec3
--- /dev/null
+++ b/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_openpose_fullres_nohand.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:52f6fcbdf86500194eb47ab9363ddd28d74dfaed941952027bcaed94930d04c2
+size 44728
diff --git a/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_sam2_mask.jpg b/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_sam2_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..3c9e08dcd470df4e023d16dc62605505eef0cd6f
--- /dev/null
+++ b/examples/examples/93bc1c43af2d6c91ac2fc966bf7725a2/93bc1c43af2d6c91ac2fc966bf7725a2_sam2_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:01a898e2e670579dc9e07d08cb435011dcaea15042a706ace1859bde1433e9b9
+size 299906
diff --git a/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a.jpg b/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..0db427c7d1fb49177999a9ba9c7911a07dc32df9
--- /dev/null
+++ b/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:82982ee7b0876bfc086d293f590cb6515b674f1561b935c83df51959d670f9cb
+size 189166
diff --git a/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_ben2-background-removal.jpg b/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_ben2-background-removal.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..e8766e81274be2c54f46f6fe2f1a9aeb9c48c184
--- /dev/null
+++ b/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_ben2-background-removal.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:466c862b6b15c01e9b047722e5b1a28e52140a90de5ae20b5abd900f3a455f8c
+size 34031
diff --git a/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_canny_100_200_512.jpg b/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..6e134c80b3a84ef029a69a7a68f0061a88193d20
--- /dev/null
+++ b/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6808a53974b22e973b6f2cfb54d1863ff9e92c1119bd6d2c48442986fa4d9967
+size 166906
diff --git a/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_depth-anything-v2_Large.jpg b/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..3bc23d620e5197e251f82fcc7167d6f3bc335ca7
--- /dev/null
+++ b/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5037b5ca4f29c91c5c2eab7e630adcff2baeaed89b06443b8ba6d1f0333fe086
+size 52743
diff --git a/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_dsine_normal_map.jpg b/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_dsine_normal_map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..6f67bca45a184a7aa5be2a9821b896a20b3ef49b
--- /dev/null
+++ b/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_dsine_normal_map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:260ac4db7c59a61b5455379fcf7d0ecdbd5ab5d54e753d90349e848de63d3a9d
+size 77361
diff --git a/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_hed_512.jpg b/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..400141db2cf95f45f1e1224bfc5696e102381882
--- /dev/null
+++ b/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c363781e15ffe55a5f3cdc7174f84bb3f127d65cb81cc55c2974b6765e6f59ff
+size 85662
diff --git a/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_sam2_mask.jpg b/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_sam2_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..6646ff3cd90ddafd606283c5e1bd769715866d1e
--- /dev/null
+++ b/examples/examples/9c565b1aad76b22f5bb836744a93561a/9c565b1aad76b22f5bb836744a93561a_sam2_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b193a23dfe8736be3c86b9fe3f8465974b88b6e34161843cc58b8746df4b488b
+size 166401
diff --git a/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710.jpg b/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..7c83fb5b3e2d7fdc71178c809f334a6c5ad89ebe
--- /dev/null
+++ b/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d6a03d1b9361ee349a0ce712a683bf9ae5bc7b3f58a76fea17a112a6717629fa
+size 547958
diff --git a/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_ben2-background-removal.jpg b/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_ben2-background-removal.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..aab2be204f2cc65ce0fcefdb1183118295e4aacd
--- /dev/null
+++ b/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_ben2-background-removal.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:add9a1d54e241659451ece48c55c9e1055784e84be06a237a7ede3a5798352cd
+size 218494
diff --git a/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_canny_100_200_512.jpg b/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..7ab4076d1f8ba30025b3534b80414026d2f7e4bc
--- /dev/null
+++ b/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:91efee1da06d1703a0d2ff8a2b23001e853398c142828dda51b4bc5fd58ab923
+size 466736
diff --git a/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_depth-anything-v2_Large.jpg b/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a86db645d0bd17f0651dd527e0f42648c201d694
--- /dev/null
+++ b/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:184f4f16a3d129872782c36f8ab0cdfe68700050ee73b3aa808a8a25264a7f05
+size 96751
diff --git a/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_dsine_normal_map.jpg b/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_dsine_normal_map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..38d9b513a918673c8504409aeef9a9edf45803ce
--- /dev/null
+++ b/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_dsine_normal_map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:69d5df967de28ab4805bbb40ddc6a7d3af6ba5bec86793fcc2a646c2986da6c3
+size 196664
diff --git a/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_hed_512.jpg b/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..7420662902c73d43c8029307bb1da3c8f67b8244
--- /dev/null
+++ b/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9698f695346cf4ac277153e6d0a8ebbf8b0567b09adf50b482bfaaa2cec6b5b3
+size 216125
diff --git a/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_sam2_mask.jpg b/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_sam2_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..0022d5ce2ba5a6275b86fae1d198d704a2d1ed9e
--- /dev/null
+++ b/examples/examples/9d39f75f1f728e097efeaff39acb4710/9d39f75f1f728e097efeaff39acb4710_sam2_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:17e141b2fdda33dcf366d1e4df63f1e27d7e0043d9275bcd9c2be2ecb7852642
+size 231095
diff --git a/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90.jpg b/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..ff84bd387545f28480fa947e0679434065a1e442
--- /dev/null
+++ b/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:86bf656841c0882c813b7c76530590d1d4b10485b1bdd79bec193496591788f9
+size 231979
diff --git a/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_ben2-background-removal.jpg b/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_ben2-background-removal.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..d8a9a319a8ebed5205d97daed53e9b4f2297d33e
--- /dev/null
+++ b/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_ben2-background-removal.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5e4e95054f96a817d193e0f00c85fa09a1f5564ed0c13aa500bfb433d8773da3
+size 86949
diff --git a/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_canny_100_200_512.jpg b/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..d1abd8364a6b60495bb0bfeff7090f6db4ba2e38
--- /dev/null
+++ b/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ef8284516b71868b1990d88c313bd4743d1cfa490cafaeaf8c525e4f3a0c67c9
+size 180458
diff --git a/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_depth-anything-v2_Large.jpg b/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..6de8e1b049a953374846abcfaaeb41f8be40c3f9
--- /dev/null
+++ b/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:096ad210cb1898f4d8b5d949ad0698b5e6f3808e20efbc59c76eb37cdb4162f5
+size 74827
diff --git a/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_dsine_normal_map.jpg b/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_dsine_normal_map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..97196fa10fb8a9e90a25e11619cae5ae199f664b
--- /dev/null
+++ b/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_dsine_normal_map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0092f2d99c56e83b9442d1d589d2624cc4a3b7d2994fa713263d4a10571e5633
+size 157782
diff --git a/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_hed_512.jpg b/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a2014c65786fdd77ecadb4577c2a4f755d6bf996
--- /dev/null
+++ b/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f9b75a04a2f2233b1fa7779088d589da008ed9a3bf940dcfab8456b559bc76f7
+size 156499
diff --git a/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_sam2_mask.jpg b/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_sam2_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..7e448004212cdc26fdbc38f6db776ea6a4ef6a6c
--- /dev/null
+++ b/examples/examples/de5a8b250bf407aa7e04913562dcba90/de5a8b250bf407aa7e04913562dcba90_sam2_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ac01f3bdbd8ee0f951f069077e310e24bac3d119cf5c698306d0c0cbfccd9cb1
+size 258388
diff --git a/examples/examples/env/1_source.jpg b/examples/examples/env/1_source.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..294fa7e430fbf8665490f4ffeb9661d6acbd3d95
--- /dev/null
+++ b/examples/examples/env/1_source.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:02902e10de12106ab4c94445e15c0a66166de4359e0b664a832971730de50c9a
+size 175651
diff --git a/examples/examples/env/1_target.jpg b/examples/examples/env/1_target.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..485360c25497049b0f3877d72fc7fecbc79f3b86
--- /dev/null
+++ b/examples/examples/env/1_target.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c0ff39133ef63671c7b1429031e978275e1170f5ecaba8c556e9b0f1eca66c1f
+size 135680
diff --git a/examples/examples/env/2_source.jpg b/examples/examples/env/2_source.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..35c1762c228511852a13b64243428d1026d67333
--- /dev/null
+++ b/examples/examples/env/2_source.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:67f4b04e8913353a68f4252b31f2c1d063b5c829bb6c9e647e6743871e9f9c2a
+size 71884
diff --git a/examples/examples/env/2_target.jpg b/examples/examples/env/2_target.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..ef4c3e157f8d38957142770221b82b7b49d6ec84
--- /dev/null
+++ b/examples/examples/env/2_target.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b1d831d1b2ea43d49635e3fa1907a28cb7ee105b62fab6c48fefc250e83e0429
+size 69771
diff --git a/examples/examples/env/3_source.jpg b/examples/examples/env/3_source.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..dcd6338ea77ad5faece68834768ad238fa91a391
--- /dev/null
+++ b/examples/examples/env/3_source.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ad70a98bf80b7fb47574fdc1dc587910ba1a844905e8d41099f62ba2c7048eb1
+size 100764
diff --git a/examples/examples/env/3_target.jpg b/examples/examples/env/3_target.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..600daa669e5fe03305ceecfa0f659a4823abfc4c
--- /dev/null
+++ b/examples/examples/env/3_target.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:52dd67a81387726c331aa2369b9cee2149169ea5818d2b4efe7ccd987d22ad01
+size 91556
diff --git a/examples/examples/face/2ef6aa5a-e751-4bf2-a302-0237ab460627/face_1.jpg b/examples/examples/face/2ef6aa5a-e751-4bf2-a302-0237ab460627/face_1.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..67f2216ee2980728ccd4def5408a3c52ebde6929
--- /dev/null
+++ b/examples/examples/face/2ef6aa5a-e751-4bf2-a302-0237ab460627/face_1.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c62192905568842cca8673307216704a0bd3b15dec83689a489d527dd048edbb
+size 108222
diff --git a/examples/examples/face/2ef6aa5a-e751-4bf2-a302-0237ab460627/face_6.jpg b/examples/examples/face/2ef6aa5a-e751-4bf2-a302-0237ab460627/face_6.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a13dc525fc4a00a622c0cf2ad91ec4420f08b98a
--- /dev/null
+++ b/examples/examples/face/2ef6aa5a-e751-4bf2-a302-0237ab460627/face_6.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8c0582e2c9a5123b2c19b7fafa03dd3451f76eb7fd8727fea692ee88652a3e67
+size 126583
diff --git a/examples/examples/face/2ef6aa5a-e751-4bf2-a302-0237ab460627/face_8.jpg b/examples/examples/face/2ef6aa5a-e751-4bf2-a302-0237ab460627/face_8.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..bd5042c6dcfdd9473cb0cb2819a012007912b1de
--- /dev/null
+++ b/examples/examples/face/2ef6aa5a-e751-4bf2-a302-0237ab460627/face_8.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8bef4b34e1ab6ada3a068a96119db7f9018b4a432b48a63b9184b66ed4fc2186
+size 116108
diff --git a/examples/examples/face/34e1633a-369f-4324-86c3-3e6418ec00be/face_0.jpg b/examples/examples/face/34e1633a-369f-4324-86c3-3e6418ec00be/face_0.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..ebafe19c73dc75f9b70edae491c78c5f19cf596d
--- /dev/null
+++ b/examples/examples/face/34e1633a-369f-4324-86c3-3e6418ec00be/face_0.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ed633130911d34da42e1daa3ad8d8bcae480a924085217fb5414ea5f74374880
+size 119970
diff --git a/examples/examples/face/34e1633a-369f-4324-86c3-3e6418ec00be/face_1.jpg b/examples/examples/face/34e1633a-369f-4324-86c3-3e6418ec00be/face_1.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..b805b69641a963f3303a1f832e780191c77b1d7e
--- /dev/null
+++ b/examples/examples/face/34e1633a-369f-4324-86c3-3e6418ec00be/face_1.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0f2717a2d5839f61aea0e8205ce87cd09bff0f80889feadd6a2f92273cecc90f
+size 116791
diff --git a/examples/examples/face/34e1633a-369f-4324-86c3-3e6418ec00be/face_2.jpg b/examples/examples/face/34e1633a-369f-4324-86c3-3e6418ec00be/face_2.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..b36d15b77505fa3979c90521cef07d81a57f7ea1
--- /dev/null
+++ b/examples/examples/face/34e1633a-369f-4324-86c3-3e6418ec00be/face_2.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c06881da347ee30527baac9024c553501209463f2775c72218a67c3ce0235d04
+size 126311
diff --git a/examples/examples/face/cb5d403a-f1bb-4392-8302-24846893a797/face_0.jpg b/examples/examples/face/cb5d403a-f1bb-4392-8302-24846893a797/face_0.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..ca8b87bc9ca4d928603672d7b5302069faae2592
--- /dev/null
+++ b/examples/examples/face/cb5d403a-f1bb-4392-8302-24846893a797/face_0.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3b573b3fb863ec8bf95409ef18416215148a9a3967c6bcdbe7ebae3b80b76605
+size 127442
diff --git a/examples/examples/face/cb5d403a-f1bb-4392-8302-24846893a797/face_1.jpg b/examples/examples/face/cb5d403a-f1bb-4392-8302-24846893a797/face_1.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..1fe84e5cd7162aab1f95f6a3541fd66e477cc33b
--- /dev/null
+++ b/examples/examples/face/cb5d403a-f1bb-4392-8302-24846893a797/face_1.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1716fac314e1fa5b53a490b485fb21adef8ea987dca41c0ae09b977f8180988a
+size 115079
diff --git a/examples/examples/face/cb5d403a-f1bb-4392-8302-24846893a797/face_2.jpg b/examples/examples/face/cb5d403a-f1bb-4392-8302-24846893a797/face_2.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..4ae968256b1eb59c7838a32a42894e1d9276b29d
--- /dev/null
+++ b/examples/examples/face/cb5d403a-f1bb-4392-8302-24846893a797/face_2.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3145b139a80d1c2bf5d5e22c3d25ddb01b08a45f2e5321d23ec312a7e9b1e97e
+size 142203
diff --git a/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_canny_100_200_512.jpg b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..63068b39b84bf9177aabaeee4c59cb8be4bc4c70
--- /dev/null
+++ b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b15cfc5c5a95d4cf79dcb224313d5154bdd8a270ec07ed59c24de7426d182ad4
+size 48224
diff --git a/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_depth-anything-v2_Large.jpg b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..b42c249099c95eda685246062cc810e758c33e32
--- /dev/null
+++ b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:078800702d6965c296d80f4034774746faf1cc5c0f6ce079032fa5a9090a59a8
+size 19603
diff --git a/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_dsine-normal-map.jpg b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_dsine-normal-map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..8c4189e129e8d45e401021c217cd13d08f15ef84
--- /dev/null
+++ b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_dsine-normal-map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d5dccd08e019f1509297f548f4735c4520e837502f61cb9a1e2e4784d1d713d8
+size 42117
diff --git a/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_hed_512.jpg b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..657fff65cde0027ed1d77ce32d3c33ea2c738f98
--- /dev/null
+++ b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:647e0a4d505ccb717cf11f20f2fc709077a8d91abb6290881ee0ba7e7944c7aa
+size 49384
diff --git a/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_instantx-style_0.jpg b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_instantx-style_0.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..f7cf99cddb08668d018727a263edd6936b156131
--- /dev/null
+++ b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_instantx-style_0.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:383e5d910b0b81c0223a8e235dceb1a58f3c17527219ed22e71e6fd8506e1f5a
+size 78742
diff --git a/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_instantx-style_0_style.jpg b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_instantx-style_0_style.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a5de6e66cfc031bef896514f42ff17f711c1aa87
--- /dev/null
+++ b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_instantx-style_0_style.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:da994e461ec6d17bb36212c4235ed69478ee7e23c5bbee00a8d1cf1a8943c346
+size 73211
diff --git a/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_reference.jpg b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_reference.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..358b5fe7cf46b0f2438ca0d3bd1a464ee69d4164
--- /dev/null
+++ b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_reference.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:817f3f56ff630a93fa540fdf34eb1c8138ef92d78118cd1fe0213f17c0a4a7a9
+size 23999
diff --git a/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_sam2_mask.jpg b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_sam2_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..2d9ec1457c25abf833beecf69a6c0a441cca565b
--- /dev/null
+++ b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_sam2_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d2d3addc2da54e71a9220848a4b1576a53c434a911ad4845bb43215fe880c270
+size 65826
diff --git a/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_target.jpg b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_target.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..c50875cae5b716888a639283deef38d2111853ed
--- /dev/null
+++ b/examples/examples/graph200k/data-00004-of-00022-7170/data-00004-of-00022-7170_target.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:01f49ea39a67ed6e70b5e6eb8433665359230e9376e201660b546fd6087c2caf
+size 41013
diff --git a/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_canny_100_200_512.jpg b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..ac6fd314678d848424395fd7ea4439e94ec9e1eb
--- /dev/null
+++ b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7048164e57a1205b4532c31d84662d84a0e6eb6a12f0ab84437e3753e697b1a2
+size 73610
diff --git a/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_depth-anything-v2_Large.jpg b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..ad9e9aac3a3bc2166cd56da2459d5691923b4c74
--- /dev/null
+++ b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:07bab247edccb82519a0235ca942de79c2d3ecfcd4a93c7ec4da47fc324eaaf2
+size 38154
diff --git a/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_dsine-normal-map.jpg b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_dsine-normal-map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..1bb59bb65b9d71741c148ae5ce11cbde06373662
--- /dev/null
+++ b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_dsine-normal-map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7f3888f32630f23f62c9c322fd81c4c8996969e9090e8a2494f14b025494d9e4
+size 49710
diff --git a/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_hed_512.jpg b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..59f9caa65bf3fe9dec1c534a3c2f84658a5d21cc
--- /dev/null
+++ b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:318d6d5474d20eb82ad4dc00a85705da7195babd4f03a90e91836320a626e9c9
+size 68948
diff --git a/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_instantx-style_0.jpg b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_instantx-style_0.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..03d2d1caa08dc59d56df19901273d518f5b928d8
--- /dev/null
+++ b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_instantx-style_0.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b5de1cd109c39dad234d3ddbee98ea062e8f402f2731bee2e1048173879c7c77
+size 73756
diff --git a/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_instantx-style_0_style.jpg b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_instantx-style_0_style.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..b4482d8c97f99b7b435925fd99fba2786e1d8087
--- /dev/null
+++ b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_instantx-style_0_style.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:86d45afb07aabfcc2e745699371313741774fdc314fc095594a7c0c55969f323
+size 34397
diff --git a/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_reference.jpg b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_reference.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..4ee94f9593c6a3ca34bb46f6b15c058535e40d8c
--- /dev/null
+++ b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_reference.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0ddf19e591931fe462dfcb6543f6f73db11c2204acd782a586469850c1ff4d7e
+size 32303
diff --git a/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_sam2_mask.jpg b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_sam2_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..9d5a3e45a575ba96df9dca952d0c9990a06492a1
--- /dev/null
+++ b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_sam2_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:465e496a2bf7ce323677a008db02f88feaddfd8777b62993912b0276e54209f3
+size 97874
diff --git a/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_target.jpg b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_target.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..4c7529405b4852f9e1725a5775312a9931c9783e
--- /dev/null
+++ b/examples/examples/graph200k/data-00005-of-00022-4396/data-00005-of-00022-4396_target.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7c2deaef15acc4f1957734daa846d71132c8b3744d72c22c41a238ca39c381e2
+size 55262
diff --git a/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_canny_100_200_512.jpg b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..9f3451b0f3f827c72fad69b47678beac33a9a71a
--- /dev/null
+++ b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b59f226141f7a4a9664768aa590c410d77949a167a3711f90ade163118e48d93
+size 69863
diff --git a/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_depth-anything-v2_Large.jpg b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..59feb1ea9fa5664ca1c9ed0479d1ba71aeb5f51b
--- /dev/null
+++ b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:88653f98c9a9cbe0a398980cea303a72be47956a51a0e752613779fc7d13ede0
+size 26149
diff --git a/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_dsine-normal-map.jpg b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_dsine-normal-map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..b1603f14e6160bed2a9de9a645d3594a7910a6b4
--- /dev/null
+++ b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_dsine-normal-map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3dc9f12e3ba03286ba09e3b9c3a8e0f52ed79fa02451395d7b9c807c8833e469
+size 53699
diff --git a/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_hed_512.jpg b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..4d20921e659afd55a8e05c850a7f29855b066a07
--- /dev/null
+++ b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ebac25d3290de7716b88d417edd26b693aee1af4825908d63c93f3438849b52d
+size 59714
diff --git a/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_instantx-style_0.jpg b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_instantx-style_0.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..bcba03d100d9510ab716ce1d25cfd944641721f5
--- /dev/null
+++ b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_instantx-style_0.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4e013015484b7cd6d159b1668aa7bc7ccb9cdfc4e5e69c988e572ec98630dbdd
+size 119813
diff --git a/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_instantx-style_0_style.jpg b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_instantx-style_0_style.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..78fda34a4209bbe3a646004013605348dda41ae8
--- /dev/null
+++ b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_instantx-style_0_style.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:eab6412526d8cee26c26afc79d942c7c248012ac00f6a07ece4d68de8d27d02e
+size 221058
diff --git a/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_reference.jpg b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_reference.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..bbdfac672931b97becb110bd822fa4ea7d624e93
--- /dev/null
+++ b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_reference.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:54a562e1b6c203192edd1f0ca9cf45dd7dabbcc2a86891a2cd7574f9be28169a
+size 37950
diff --git a/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_sam2_mask.jpg b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_sam2_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..2d2ff2615effa109a9d9b840e66d618f85fa3f91
--- /dev/null
+++ b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_sam2_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6fbd3e660f852a79e0106df0c5989f7fe7332f34a612af417f01e01cb4cb08ea
+size 90743
diff --git a/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_target.jpg b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_target.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..2b4026065f16bdc5ce93c1625b9d6646ca29f909
--- /dev/null
+++ b/examples/examples/graph200k/data-00013-of-00022-4696/data-00013-of-00022-4696_target.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:66c8ad61faaa50402594cdaa7669f43ada359d20cd573f10100dd27af5604e3b
+size 62085
diff --git a/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_canny_100_200_512.jpg b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..1365bc103fe239443c1f944b8f1640779b7bf728
--- /dev/null
+++ b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c6c635ff97c6053e5183b35253327802aa1ba28fd89be36f7e6b35eca9eb6e85
+size 99971
diff --git a/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_depth-anything-v2_Large.jpg b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..582959dbcfa04a1ee97ad9087822660933f034f2
--- /dev/null
+++ b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:17b52d33c0dceb2d5febb4ab79df791688214cef88b0637ab6c8a6e9fb541efe
+size 29961
diff --git a/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_dsine-normal-map.jpg b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_dsine-normal-map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..af5c9460bfe179739c4568290b41f1f065762961
--- /dev/null
+++ b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_dsine-normal-map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:052cf694ad5d11e1a3913632812a4e51dfa0667792e3a218bfbd0479ef4d0ec8
+size 65669
diff --git a/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_hed_512.jpg b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..6564728df633239b6ea536ff3cb160f656ffc765
--- /dev/null
+++ b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f321bda65f278ef578e726d6a9402a0abaf644c0b689da00f11c44aa8fd17ea8
+size 75710
diff --git a/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_instantx-style_0.jpg b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_instantx-style_0.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..7e18f6e1097df931e4c7bdb7a449f4b243418549
--- /dev/null
+++ b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_instantx-style_0.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2bfc9571ca02ce09af124fda0e651224f9c8023e23f167a7b52800cbcb7eee9d
+size 103019
diff --git a/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_instantx-style_0_style.jpg b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_instantx-style_0_style.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..b95d909ba16ef99bf5294ca4c6d982af92046fc9
--- /dev/null
+++ b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_instantx-style_0_style.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:99a0dd362afe69f12799bd319053bcb2dd41c916e1ba7034d0bfda5dfcdfd43f
+size 213002
diff --git a/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_reference.jpg b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_reference.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..58920256beefcd9411f100d2fcc46afed7a64b59
--- /dev/null
+++ b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_reference.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:53ac22c893ab8700720b71f40ee39b45058a896b4bb408ebd5c1e141f8dd71c2
+size 29143
diff --git a/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_sam2_mask.jpg b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_sam2_mask.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..8f92e909319c611d98a92dbf56e54ca69aae42a9
--- /dev/null
+++ b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_sam2_mask.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:06e665ce4f90e02b1b198f06427e15025dc0b471947fb8102c0761728eb19b9a
+size 117217
diff --git a/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_target.jpg b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_target.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..e7d19fab9e9eb7201544e2c84cd43bb4ab521474
--- /dev/null
+++ b/examples/examples/graph200k/data-00017-of-00022-8377/data-00017-of-00022-8377_target.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5a858b85929171aa94400c5be23b56c3dc2f66b1c6c3969ac949f9f3edd72a2f
+size 71908
diff --git a/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_canny_100_200_512.jpg b/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_canny_100_200_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..0bd8b94c88f5a8c6d86e60b8c916e2c8319754ac
--- /dev/null
+++ b/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_canny_100_200_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9c3f2d8ea9e2d0b47ec7714f3608cf277d239ab6413cabd0a7cb5ba566ccb1d7
+size 86138
diff --git a/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_depth-anything-v2_Large.jpg b/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_depth-anything-v2_Large.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..1098c4a984ebb9f88c360f1420af7df092997eb1
--- /dev/null
+++ b/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_depth-anything-v2_Large.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:aff70beb3d4faaaf700a4b8f0c764a86c842dfad4d40c91c5fadfd1d90a46f6d
+size 24413
diff --git a/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_dsine-normal-map.jpg b/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_dsine-normal-map.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..c0d2503b432de2725182afd83ecbece3c52a44bb
--- /dev/null
+++ b/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_dsine-normal-map.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3f2037c206c3d1b2a53188a608958c34f19f4422d2b8f629db4d17ef7ac8d18c
+size 47579
diff --git a/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_hed_512.jpg b/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_hed_512.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..717b819645a708bc1cf3427c2a2bd5b8d9dbd3c9
--- /dev/null
+++ b/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_hed_512.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b72b11736dd0e832eb0b9e8cedfb94e24295ad9a32e6cd0d63068310a734ded0
+size 56659
diff --git a/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_instantx-style_0.jpg b/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_instantx-style_0.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..01cf618a23f785566c9fc9a8fd007be6c8a826b3
--- /dev/null
+++ b/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_instantx-style_0.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5e2e88b75cf761bcf487976e24aea95b2b59ca79c5d8d20a2bcd9d613254c164
+size 83988
diff --git a/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_instantx-style_0_style.jpg b/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_instantx-style_0_style.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..3e5a76301ad9665970c7c62ba6ad1beaeb971a78
--- /dev/null
+++ b/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_instantx-style_0_style.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9494efc8a6aa334fa731463ddefb2bdb6d1d103d54525d68c7a21246d41b8556
+size 70863
diff --git a/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_reference.jpg b/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_reference.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..2129f9c944e29e291065a3940541901583e63784
--- /dev/null
+++ b/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_reference.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e824555881f36b46c8cd373cda1d1ce4135f4e3fcd8d72f42fdb16b700f4e536
+size 38089
diff --git a/demo_tasks/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_sam2_mask.jpg b/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_sam2_mask.jpg
similarity index 100%
rename from demo_tasks/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_sam2_mask.jpg
rename to examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_sam2_mask.jpg
diff --git a/demo_tasks/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_target.jpg b/examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_target.jpg
similarity index 100%
rename from demo_tasks/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_target.jpg
rename to examples/examples/graph200k/data-00018-of-00022-4948/data-00018-of-00022-4948_target.jpg
diff --git a/demo_tasks/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_qwen_subject_replacement_1737373818845_1.jpg b/examples/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_qwen_subject_replacement_1737373818845_1.jpg
similarity index 100%
rename from demo_tasks/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_qwen_subject_replacement_1737373818845_1.jpg
rename to examples/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_qwen_subject_replacement_1737373818845_1.jpg
diff --git a/demo_tasks/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_reference.jpg b/examples/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_reference.jpg
similarity index 100%
rename from demo_tasks/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_reference.jpg
rename to examples/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_reference.jpg
diff --git a/demo_tasks/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_target.jpg b/examples/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_target.jpg
similarity index 100%
rename from demo_tasks/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_target.jpg
rename to examples/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_target.jpg
diff --git a/demo_tasks/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_qwen_subject_replacement_1737377830929_2.jpg b/examples/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_qwen_subject_replacement_1737377830929_2.jpg
similarity index 100%
rename from demo_tasks/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_qwen_subject_replacement_1737377830929_2.jpg
rename to examples/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_qwen_subject_replacement_1737377830929_2.jpg
diff --git a/demo_tasks/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_reference.jpg b/examples/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_reference.jpg
similarity index 100%
rename from demo_tasks/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_reference.jpg
rename to examples/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_reference.jpg
diff --git a/demo_tasks/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_target.jpg b/examples/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_target.jpg
similarity index 100%
rename from demo_tasks/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_target.jpg
rename to examples/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_target.jpg
diff --git a/demo_tasks/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_qwen_subject_replacement_1737410088010_2.jpg b/examples/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_qwen_subject_replacement_1737410088010_2.jpg
similarity index 100%
rename from demo_tasks/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_qwen_subject_replacement_1737410088010_2.jpg
rename to examples/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_qwen_subject_replacement_1737410088010_2.jpg
diff --git a/demo_tasks/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_reference.jpg b/examples/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_reference.jpg
similarity index 100%
rename from demo_tasks/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_reference.jpg
rename to examples/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_reference.jpg
diff --git a/demo_tasks/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_target.jpg b/examples/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_target.jpg
similarity index 100%
rename from demo_tasks/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_target.jpg
rename to examples/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_target.jpg
diff --git a/demo_tasks/examples/omniedit/task_obj_add_273266.jpg b/examples/examples/omniedit/task_obj_add_273266.jpg
similarity index 100%
rename from demo_tasks/examples/omniedit/task_obj_add_273266.jpg
rename to examples/examples/omniedit/task_obj_add_273266.jpg
diff --git a/demo_tasks/examples/omniedit/task_obj_add_273266_edit.jpg b/examples/examples/omniedit/task_obj_add_273266_edit.jpg
similarity index 100%
rename from demo_tasks/examples/omniedit/task_obj_add_273266_edit.jpg
rename to examples/examples/omniedit/task_obj_add_273266_edit.jpg
diff --git a/demo_tasks/examples/omniedit/task_obj_add_528329.jpg b/examples/examples/omniedit/task_obj_add_528329.jpg
similarity index 100%
rename from demo_tasks/examples/omniedit/task_obj_add_528329.jpg
rename to examples/examples/omniedit/task_obj_add_528329.jpg
diff --git a/demo_tasks/examples/omniedit/task_obj_add_528329_edit.jpg b/examples/examples/omniedit/task_obj_add_528329_edit.jpg
similarity index 100%
rename from demo_tasks/examples/omniedit/task_obj_add_528329_edit.jpg
rename to examples/examples/omniedit/task_obj_add_528329_edit.jpg
diff --git a/demo_tasks/examples/omniedit/task_obj_remove_855511.jpg b/examples/examples/omniedit/task_obj_remove_855511.jpg
similarity index 100%
rename from demo_tasks/examples/omniedit/task_obj_remove_855511.jpg
rename to examples/examples/omniedit/task_obj_remove_855511.jpg
diff --git a/demo_tasks/examples/omniedit/task_obj_remove_855511_edit.jpg b/examples/examples/omniedit/task_obj_remove_855511_edit.jpg
similarity index 100%
rename from demo_tasks/examples/omniedit/task_obj_remove_855511_edit.jpg
rename to examples/examples/omniedit/task_obj_remove_855511_edit.jpg
diff --git a/demo_tasks/examples/photodoodle/sksedgeeffect/1.jpg b/examples/examples/photodoodle/sksedgeeffect/1.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/sksedgeeffect/1.jpg
rename to examples/examples/photodoodle/sksedgeeffect/1.jpg
diff --git a/demo_tasks/examples/photodoodle/sksedgeeffect/1_blend.jpg b/examples/examples/photodoodle/sksedgeeffect/1_blend.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/sksedgeeffect/1_blend.jpg
rename to examples/examples/photodoodle/sksedgeeffect/1_blend.jpg
diff --git a/demo_tasks/examples/photodoodle/sksedgeeffect/34.jpg b/examples/examples/photodoodle/sksedgeeffect/34.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/sksedgeeffect/34.jpg
rename to examples/examples/photodoodle/sksedgeeffect/34.jpg
diff --git a/demo_tasks/examples/photodoodle/sksedgeeffect/34_blend.jpg b/examples/examples/photodoodle/sksedgeeffect/34_blend.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/sksedgeeffect/34_blend.jpg
rename to examples/examples/photodoodle/sksedgeeffect/34_blend.jpg
diff --git a/demo_tasks/examples/photodoodle/sksmagiceffects/24.jpg b/examples/examples/photodoodle/sksmagiceffects/24.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/sksmagiceffects/24.jpg
rename to examples/examples/photodoodle/sksmagiceffects/24.jpg
diff --git a/demo_tasks/examples/photodoodle/sksmagiceffects/24_blend.jpg b/examples/examples/photodoodle/sksmagiceffects/24_blend.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/sksmagiceffects/24_blend.jpg
rename to examples/examples/photodoodle/sksmagiceffects/24_blend.jpg
diff --git a/demo_tasks/examples/photodoodle/sksmagiceffects/29.jpg b/examples/examples/photodoodle/sksmagiceffects/29.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/sksmagiceffects/29.jpg
rename to examples/examples/photodoodle/sksmagiceffects/29.jpg
diff --git a/demo_tasks/examples/photodoodle/sksmagiceffects/29_blend.jpg b/examples/examples/photodoodle/sksmagiceffects/29_blend.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/sksmagiceffects/29_blend.jpg
rename to examples/examples/photodoodle/sksmagiceffects/29_blend.jpg
diff --git a/demo_tasks/examples/photodoodle/sksmagiceffects/50.jpg b/examples/examples/photodoodle/sksmagiceffects/50.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/sksmagiceffects/50.jpg
rename to examples/examples/photodoodle/sksmagiceffects/50.jpg
diff --git a/demo_tasks/examples/photodoodle/sksmagiceffects/50_blend.jpg b/examples/examples/photodoodle/sksmagiceffects/50_blend.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/sksmagiceffects/50_blend.jpg
rename to examples/examples/photodoodle/sksmagiceffects/50_blend.jpg
diff --git a/demo_tasks/examples/photodoodle/sksmonstercalledlulu/5.jpg b/examples/examples/photodoodle/sksmonstercalledlulu/5.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/sksmonstercalledlulu/5.jpg
rename to examples/examples/photodoodle/sksmonstercalledlulu/5.jpg
diff --git a/demo_tasks/examples/photodoodle/sksmonstercalledlulu/5_blend.jpg b/examples/examples/photodoodle/sksmonstercalledlulu/5_blend.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/sksmonstercalledlulu/5_blend.jpg
rename to examples/examples/photodoodle/sksmonstercalledlulu/5_blend.jpg
diff --git a/demo_tasks/examples/photodoodle/sksmonstercalledlulu/6.jpg b/examples/examples/photodoodle/sksmonstercalledlulu/6.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/sksmonstercalledlulu/6.jpg
rename to examples/examples/photodoodle/sksmonstercalledlulu/6.jpg
diff --git a/demo_tasks/examples/photodoodle/sksmonstercalledlulu/6_blend.jpg b/examples/examples/photodoodle/sksmonstercalledlulu/6_blend.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/sksmonstercalledlulu/6_blend.jpg
rename to examples/examples/photodoodle/sksmonstercalledlulu/6_blend.jpg
diff --git a/demo_tasks/examples/photodoodle/sksmonstercalledlulu/9.jpg b/examples/examples/photodoodle/sksmonstercalledlulu/9.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/sksmonstercalledlulu/9.jpg
rename to examples/examples/photodoodle/sksmonstercalledlulu/9.jpg
diff --git a/demo_tasks/examples/photodoodle/sksmonstercalledlulu/9_blend.jpg b/examples/examples/photodoodle/sksmonstercalledlulu/9_blend.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/sksmonstercalledlulu/9_blend.jpg
rename to examples/examples/photodoodle/sksmonstercalledlulu/9_blend.jpg
diff --git a/demo_tasks/examples/photodoodle/skspaintingeffects/12.jpg b/examples/examples/photodoodle/skspaintingeffects/12.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/skspaintingeffects/12.jpg
rename to examples/examples/photodoodle/skspaintingeffects/12.jpg
diff --git a/demo_tasks/examples/photodoodle/skspaintingeffects/12_blend.jpg b/examples/examples/photodoodle/skspaintingeffects/12_blend.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/skspaintingeffects/12_blend.jpg
rename to examples/examples/photodoodle/skspaintingeffects/12_blend.jpg
diff --git a/demo_tasks/examples/photodoodle/skspaintingeffects/35.jpg b/examples/examples/photodoodle/skspaintingeffects/35.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/skspaintingeffects/35.jpg
rename to examples/examples/photodoodle/skspaintingeffects/35.jpg
diff --git a/demo_tasks/examples/photodoodle/skspaintingeffects/35_blend.jpg b/examples/examples/photodoodle/skspaintingeffects/35_blend.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/skspaintingeffects/35_blend.jpg
rename to examples/examples/photodoodle/skspaintingeffects/35_blend.jpg
diff --git a/demo_tasks/examples/photodoodle/skspaintingeffects/37.jpg b/examples/examples/photodoodle/skspaintingeffects/37.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/skspaintingeffects/37.jpg
rename to examples/examples/photodoodle/skspaintingeffects/37.jpg
diff --git a/demo_tasks/examples/photodoodle/skspaintingeffects/37_blend.jpg b/examples/examples/photodoodle/skspaintingeffects/37_blend.jpg
similarity index 100%
rename from demo_tasks/examples/photodoodle/skspaintingeffects/37_blend.jpg
rename to examples/examples/photodoodle/skspaintingeffects/37_blend.jpg
diff --git a/demo_tasks/examples/property/1_source.jpg b/examples/examples/property/1_source.jpg
similarity index 100%
rename from demo_tasks/examples/property/1_source.jpg
rename to examples/examples/property/1_source.jpg
diff --git a/demo_tasks/examples/property/1_target.jpg b/examples/examples/property/1_target.jpg
similarity index 100%
rename from demo_tasks/examples/property/1_target.jpg
rename to examples/examples/property/1_target.jpg
diff --git a/demo_tasks/examples/property/2_source.jpg b/examples/examples/property/2_source.jpg
similarity index 100%
rename from demo_tasks/examples/property/2_source.jpg
rename to examples/examples/property/2_source.jpg
diff --git a/demo_tasks/examples/property/2_target.jpg b/examples/examples/property/2_target.jpg
similarity index 100%
rename from demo_tasks/examples/property/2_target.jpg
rename to examples/examples/property/2_target.jpg
diff --git a/demo_tasks/examples/property/3_source.jpg b/examples/examples/property/3_source.jpg
similarity index 100%
rename from demo_tasks/examples/property/3_source.jpg
rename to examples/examples/property/3_source.jpg
diff --git a/demo_tasks/examples/property/3_target.jpg b/examples/examples/property/3_target.jpg
similarity index 100%
rename from demo_tasks/examples/property/3_target.jpg
rename to examples/examples/property/3_target.jpg
diff --git a/demo_tasks/examples/relighting/02aee2a8df8f6e6f16ca4ec278203543656cecf1.jpg b/examples/examples/relighting/02aee2a8df8f6e6f16ca4ec278203543656cecf1.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02aee2a8df8f6e6f16ca4ec278203543656cecf1.jpg
rename to examples/examples/relighting/02aee2a8df8f6e6f16ca4ec278203543656cecf1.jpg
diff --git a/demo_tasks/examples/relighting/02aee2a8df8f6e6f16ca4ec278203543656cecf1_Left.jpg b/examples/examples/relighting/02aee2a8df8f6e6f16ca4ec278203543656cecf1_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02aee2a8df8f6e6f16ca4ec278203543656cecf1_Left.jpg
rename to examples/examples/relighting/02aee2a8df8f6e6f16ca4ec278203543656cecf1_Left.jpg
diff --git a/demo_tasks/examples/relighting/02af06c41208b31248e94da13166a675c862b003.jpg b/examples/examples/relighting/02af06c41208b31248e94da13166a675c862b003.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02af06c41208b31248e94da13166a675c862b003.jpg
rename to examples/examples/relighting/02af06c41208b31248e94da13166a675c862b003.jpg
diff --git a/demo_tasks/examples/relighting/02af06c41208b31248e94da13166a675c862b003_Left.jpg b/examples/examples/relighting/02af06c41208b31248e94da13166a675c862b003_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02af06c41208b31248e94da13166a675c862b003_Left.jpg
rename to examples/examples/relighting/02af06c41208b31248e94da13166a675c862b003_Left.jpg
diff --git a/demo_tasks/examples/relighting/02af9925c86c22b379e4e6d4f2762d66966ee281.jpg b/examples/examples/relighting/02af9925c86c22b379e4e6d4f2762d66966ee281.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02af9925c86c22b379e4e6d4f2762d66966ee281.jpg
rename to examples/examples/relighting/02af9925c86c22b379e4e6d4f2762d66966ee281.jpg
diff --git a/demo_tasks/examples/relighting/02af9925c86c22b379e4e6d4f2762d66966ee281_Left.jpg b/examples/examples/relighting/02af9925c86c22b379e4e6d4f2762d66966ee281_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02af9925c86c22b379e4e6d4f2762d66966ee281_Left.jpg
rename to examples/examples/relighting/02af9925c86c22b379e4e6d4f2762d66966ee281_Left.jpg
diff --git a/demo_tasks/examples/relighting/02af99b6765a77a8f2ac87aa42d2f2453dcd590f.jpg b/examples/examples/relighting/02af99b6765a77a8f2ac87aa42d2f2453dcd590f.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02af99b6765a77a8f2ac87aa42d2f2453dcd590f.jpg
rename to examples/examples/relighting/02af99b6765a77a8f2ac87aa42d2f2453dcd590f.jpg
diff --git a/demo_tasks/examples/relighting/02af99b6765a77a8f2ac87aa42d2f2453dcd590f_Left.jpg b/examples/examples/relighting/02af99b6765a77a8f2ac87aa42d2f2453dcd590f_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02af99b6765a77a8f2ac87aa42d2f2453dcd590f_Left.jpg
rename to examples/examples/relighting/02af99b6765a77a8f2ac87aa42d2f2453dcd590f_Left.jpg
diff --git a/demo_tasks/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010.jpg b/examples/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010.jpg
rename to examples/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010.jpg
diff --git a/demo_tasks/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010_Left.jpg b/examples/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010_Left.jpg
rename to examples/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010_Left.jpg
diff --git a/demo_tasks/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010_depth.jpg b/examples/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010_depth.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010_depth.jpg
rename to examples/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010_depth.jpg
diff --git a/demo_tasks/examples/relighting/02afbcf084a1e35bda34c26d2271d56b6a1c621e.jpg b/examples/examples/relighting/02afbcf084a1e35bda34c26d2271d56b6a1c621e.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02afbcf084a1e35bda34c26d2271d56b6a1c621e.jpg
rename to examples/examples/relighting/02afbcf084a1e35bda34c26d2271d56b6a1c621e.jpg
diff --git a/demo_tasks/examples/relighting/02afbcf084a1e35bda34c26d2271d56b6a1c621e_Left.jpg b/examples/examples/relighting/02afbcf084a1e35bda34c26d2271d56b6a1c621e_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02afbcf084a1e35bda34c26d2271d56b6a1c621e_Left.jpg
rename to examples/examples/relighting/02afbcf084a1e35bda34c26d2271d56b6a1c621e_Left.jpg
diff --git a/demo_tasks/examples/relighting/02b02e2916bf2eb3608f5a806dc3b7ecbed3b649.jpg b/examples/examples/relighting/02b02e2916bf2eb3608f5a806dc3b7ecbed3b649.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02b02e2916bf2eb3608f5a806dc3b7ecbed3b649.jpg
rename to examples/examples/relighting/02b02e2916bf2eb3608f5a806dc3b7ecbed3b649.jpg
diff --git a/demo_tasks/examples/relighting/02b02e2916bf2eb3608f5a806dc3b7ecbed3b649_Left.jpg b/examples/examples/relighting/02b02e2916bf2eb3608f5a806dc3b7ecbed3b649_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02b02e2916bf2eb3608f5a806dc3b7ecbed3b649_Left.jpg
rename to examples/examples/relighting/02b02e2916bf2eb3608f5a806dc3b7ecbed3b649_Left.jpg
diff --git a/demo_tasks/examples/relighting/02c02535d741e8800bf5fca514a85c29f7b4d115.jpg b/examples/examples/relighting/02c02535d741e8800bf5fca514a85c29f7b4d115.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c02535d741e8800bf5fca514a85c29f7b4d115.jpg
rename to examples/examples/relighting/02c02535d741e8800bf5fca514a85c29f7b4d115.jpg
diff --git a/demo_tasks/examples/relighting/02c02535d741e8800bf5fca514a85c29f7b4d115_Left.jpg b/examples/examples/relighting/02c02535d741e8800bf5fca514a85c29f7b4d115_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c02535d741e8800bf5fca514a85c29f7b4d115_Left.jpg
rename to examples/examples/relighting/02c02535d741e8800bf5fca514a85c29f7b4d115_Left.jpg
diff --git a/demo_tasks/examples/relighting/02c032354830e33b94b50dee9a55113d91dae87b.jpg b/examples/examples/relighting/02c032354830e33b94b50dee9a55113d91dae87b.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c032354830e33b94b50dee9a55113d91dae87b.jpg
rename to examples/examples/relighting/02c032354830e33b94b50dee9a55113d91dae87b.jpg
diff --git a/demo_tasks/examples/relighting/02c032354830e33b94b50dee9a55113d91dae87b_Left.jpg b/examples/examples/relighting/02c032354830e33b94b50dee9a55113d91dae87b_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c032354830e33b94b50dee9a55113d91dae87b_Left.jpg
rename to examples/examples/relighting/02c032354830e33b94b50dee9a55113d91dae87b_Left.jpg
diff --git a/demo_tasks/examples/relighting/02c0359af5386b96429b8239783921088e007347.jpg b/examples/examples/relighting/02c0359af5386b96429b8239783921088e007347.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c0359af5386b96429b8239783921088e007347.jpg
rename to examples/examples/relighting/02c0359af5386b96429b8239783921088e007347.jpg
diff --git a/demo_tasks/examples/relighting/02c0359af5386b96429b8239783921088e007347_Left.jpg b/examples/examples/relighting/02c0359af5386b96429b8239783921088e007347_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c0359af5386b96429b8239783921088e007347_Left.jpg
rename to examples/examples/relighting/02c0359af5386b96429b8239783921088e007347_Left.jpg
diff --git a/demo_tasks/examples/relighting/02c063fcc7f36018f6b55d26c6d4e05d43474d70.jpg b/examples/examples/relighting/02c063fcc7f36018f6b55d26c6d4e05d43474d70.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c063fcc7f36018f6b55d26c6d4e05d43474d70.jpg
rename to examples/examples/relighting/02c063fcc7f36018f6b55d26c6d4e05d43474d70.jpg
diff --git a/demo_tasks/examples/relighting/02c063fcc7f36018f6b55d26c6d4e05d43474d70_Left.jpg b/examples/examples/relighting/02c063fcc7f36018f6b55d26c6d4e05d43474d70_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c063fcc7f36018f6b55d26c6d4e05d43474d70_Left.jpg
rename to examples/examples/relighting/02c063fcc7f36018f6b55d26c6d4e05d43474d70_Left.jpg
diff --git a/demo_tasks/examples/relighting/02c3760bf08f00d9e2163248e2864f5e1a70d709.jpg b/examples/examples/relighting/02c3760bf08f00d9e2163248e2864f5e1a70d709.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c3760bf08f00d9e2163248e2864f5e1a70d709.jpg
rename to examples/examples/relighting/02c3760bf08f00d9e2163248e2864f5e1a70d709.jpg
diff --git a/demo_tasks/examples/relighting/02c3760bf08f00d9e2163248e2864f5e1a70d709_Left.jpg b/examples/examples/relighting/02c3760bf08f00d9e2163248e2864f5e1a70d709_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c3760bf08f00d9e2163248e2864f5e1a70d709_Left.jpg
rename to examples/examples/relighting/02c3760bf08f00d9e2163248e2864f5e1a70d709_Left.jpg
diff --git a/demo_tasks/examples/relighting/02c39e8e82f4be91d24252c8bfbfdef033ec8a32.jpg b/examples/examples/relighting/02c39e8e82f4be91d24252c8bfbfdef033ec8a32.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c39e8e82f4be91d24252c8bfbfdef033ec8a32.jpg
rename to examples/examples/relighting/02c39e8e82f4be91d24252c8bfbfdef033ec8a32.jpg
diff --git a/demo_tasks/examples/relighting/02c39e8e82f4be91d24252c8bfbfdef033ec8a32_Left.jpg b/examples/examples/relighting/02c39e8e82f4be91d24252c8bfbfdef033ec8a32_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c39e8e82f4be91d24252c8bfbfdef033ec8a32_Left.jpg
rename to examples/examples/relighting/02c39e8e82f4be91d24252c8bfbfdef033ec8a32_Left.jpg
diff --git a/demo_tasks/examples/relighting/02c466ad25faefb2a8bbe84d20d5ca1beb323a6d.jpg b/examples/examples/relighting/02c466ad25faefb2a8bbe84d20d5ca1beb323a6d.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c466ad25faefb2a8bbe84d20d5ca1beb323a6d.jpg
rename to examples/examples/relighting/02c466ad25faefb2a8bbe84d20d5ca1beb323a6d.jpg
diff --git a/demo_tasks/examples/relighting/02c466ad25faefb2a8bbe84d20d5ca1beb323a6d_Left.jpg b/examples/examples/relighting/02c466ad25faefb2a8bbe84d20d5ca1beb323a6d_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c466ad25faefb2a8bbe84d20d5ca1beb323a6d_Left.jpg
rename to examples/examples/relighting/02c466ad25faefb2a8bbe84d20d5ca1beb323a6d_Left.jpg
diff --git a/demo_tasks/examples/relighting/02c5200cac1d0f19256232a09708ac47f6ddfab3.jpg b/examples/examples/relighting/02c5200cac1d0f19256232a09708ac47f6ddfab3.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c5200cac1d0f19256232a09708ac47f6ddfab3.jpg
rename to examples/examples/relighting/02c5200cac1d0f19256232a09708ac47f6ddfab3.jpg
diff --git a/demo_tasks/examples/relighting/02c5200cac1d0f19256232a09708ac47f6ddfab3_Left.jpg b/examples/examples/relighting/02c5200cac1d0f19256232a09708ac47f6ddfab3_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c5200cac1d0f19256232a09708ac47f6ddfab3_Left.jpg
rename to examples/examples/relighting/02c5200cac1d0f19256232a09708ac47f6ddfab3_Left.jpg
diff --git a/demo_tasks/examples/relighting/02c53f12ec3d4a9a16d9b0ca3f7773ad2222100c.jpg b/examples/examples/relighting/02c53f12ec3d4a9a16d9b0ca3f7773ad2222100c.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c53f12ec3d4a9a16d9b0ca3f7773ad2222100c.jpg
rename to examples/examples/relighting/02c53f12ec3d4a9a16d9b0ca3f7773ad2222100c.jpg
diff --git a/demo_tasks/examples/relighting/02c53f12ec3d4a9a16d9b0ca3f7773ad2222100c_Left.jpg b/examples/examples/relighting/02c53f12ec3d4a9a16d9b0ca3f7773ad2222100c_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c53f12ec3d4a9a16d9b0ca3f7773ad2222100c_Left.jpg
rename to examples/examples/relighting/02c53f12ec3d4a9a16d9b0ca3f7773ad2222100c_Left.jpg
diff --git a/demo_tasks/examples/relighting/02c5cc03d46ce15494caaf3d65a2b2c7e09089f2.jpg b/examples/examples/relighting/02c5cc03d46ce15494caaf3d65a2b2c7e09089f2.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c5cc03d46ce15494caaf3d65a2b2c7e09089f2.jpg
rename to examples/examples/relighting/02c5cc03d46ce15494caaf3d65a2b2c7e09089f2.jpg
diff --git a/demo_tasks/examples/relighting/02c5cc03d46ce15494caaf3d65a2b2c7e09089f2_Left.jpg b/examples/examples/relighting/02c5cc03d46ce15494caaf3d65a2b2c7e09089f2_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c5cc03d46ce15494caaf3d65a2b2c7e09089f2_Left.jpg
rename to examples/examples/relighting/02c5cc03d46ce15494caaf3d65a2b2c7e09089f2_Left.jpg
diff --git a/demo_tasks/examples/relighting/02c6c0f92a672110ff86bd12f4aa0d0083c9cf6b.jpg b/examples/examples/relighting/02c6c0f92a672110ff86bd12f4aa0d0083c9cf6b.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c6c0f92a672110ff86bd12f4aa0d0083c9cf6b.jpg
rename to examples/examples/relighting/02c6c0f92a672110ff86bd12f4aa0d0083c9cf6b.jpg
diff --git a/demo_tasks/examples/relighting/02c6c0f92a672110ff86bd12f4aa0d0083c9cf6b_Left.jpg b/examples/examples/relighting/02c6c0f92a672110ff86bd12f4aa0d0083c9cf6b_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c6c0f92a672110ff86bd12f4aa0d0083c9cf6b_Left.jpg
rename to examples/examples/relighting/02c6c0f92a672110ff86bd12f4aa0d0083c9cf6b_Left.jpg
diff --git a/demo_tasks/examples/relighting/02c73157a981e0ee669ca8125018efbdda1e1483.jpg b/examples/examples/relighting/02c73157a981e0ee669ca8125018efbdda1e1483.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c73157a981e0ee669ca8125018efbdda1e1483.jpg
rename to examples/examples/relighting/02c73157a981e0ee669ca8125018efbdda1e1483.jpg
diff --git a/demo_tasks/examples/relighting/02c73157a981e0ee669ca8125018efbdda1e1483_Left.jpg b/examples/examples/relighting/02c73157a981e0ee669ca8125018efbdda1e1483_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c73157a981e0ee669ca8125018efbdda1e1483_Left.jpg
rename to examples/examples/relighting/02c73157a981e0ee669ca8125018efbdda1e1483_Left.jpg
diff --git a/demo_tasks/examples/relighting/02c77b643fbdaec82912634655426553f3d7a537.jpg b/examples/examples/relighting/02c77b643fbdaec82912634655426553f3d7a537.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c77b643fbdaec82912634655426553f3d7a537.jpg
rename to examples/examples/relighting/02c77b643fbdaec82912634655426553f3d7a537.jpg
diff --git a/demo_tasks/examples/relighting/02c77b643fbdaec82912634655426553f3d7a537_Left.jpg b/examples/examples/relighting/02c77b643fbdaec82912634655426553f3d7a537_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c77b643fbdaec82912634655426553f3d7a537_Left.jpg
rename to examples/examples/relighting/02c77b643fbdaec82912634655426553f3d7a537_Left.jpg
diff --git a/demo_tasks/examples/relighting/02c7df6c0decd3d542e25089a0af6afe1e070b6a.jpg b/examples/examples/relighting/02c7df6c0decd3d542e25089a0af6afe1e070b6a.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c7df6c0decd3d542e25089a0af6afe1e070b6a.jpg
rename to examples/examples/relighting/02c7df6c0decd3d542e25089a0af6afe1e070b6a.jpg
diff --git a/demo_tasks/examples/relighting/02c7df6c0decd3d542e25089a0af6afe1e070b6a_Left.jpg b/examples/examples/relighting/02c7df6c0decd3d542e25089a0af6afe1e070b6a_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02c7df6c0decd3d542e25089a0af6afe1e070b6a_Left.jpg
rename to examples/examples/relighting/02c7df6c0decd3d542e25089a0af6afe1e070b6a_Left.jpg
diff --git a/demo_tasks/examples/relighting/02daa50ac59bb9eabcbe0d5304af880d941bffc3.jpg b/examples/examples/relighting/02daa50ac59bb9eabcbe0d5304af880d941bffc3.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02daa50ac59bb9eabcbe0d5304af880d941bffc3.jpg
rename to examples/examples/relighting/02daa50ac59bb9eabcbe0d5304af880d941bffc3.jpg
diff --git a/demo_tasks/examples/relighting/02daa50ac59bb9eabcbe0d5304af880d941bffc3_Left.jpg b/examples/examples/relighting/02daa50ac59bb9eabcbe0d5304af880d941bffc3_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02daa50ac59bb9eabcbe0d5304af880d941bffc3_Left.jpg
rename to examples/examples/relighting/02daa50ac59bb9eabcbe0d5304af880d941bffc3_Left.jpg
diff --git a/demo_tasks/examples/relighting/02daa93f44c11ebbe5942cc0b781c12e125a6c65.jpg b/examples/examples/relighting/02daa93f44c11ebbe5942cc0b781c12e125a6c65.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02daa93f44c11ebbe5942cc0b781c12e125a6c65.jpg
rename to examples/examples/relighting/02daa93f44c11ebbe5942cc0b781c12e125a6c65.jpg
diff --git a/demo_tasks/examples/relighting/02daa93f44c11ebbe5942cc0b781c12e125a6c65_Left.jpg b/examples/examples/relighting/02daa93f44c11ebbe5942cc0b781c12e125a6c65_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02daa93f44c11ebbe5942cc0b781c12e125a6c65_Left.jpg
rename to examples/examples/relighting/02daa93f44c11ebbe5942cc0b781c12e125a6c65_Left.jpg
diff --git a/demo_tasks/examples/relighting/02dac14fc596c51077015d280ea564faa1f735b5.jpg b/examples/examples/relighting/02dac14fc596c51077015d280ea564faa1f735b5.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dac14fc596c51077015d280ea564faa1f735b5.jpg
rename to examples/examples/relighting/02dac14fc596c51077015d280ea564faa1f735b5.jpg
diff --git a/demo_tasks/examples/relighting/02dac14fc596c51077015d280ea564faa1f735b5_Left.jpg b/examples/examples/relighting/02dac14fc596c51077015d280ea564faa1f735b5_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dac14fc596c51077015d280ea564faa1f735b5_Left.jpg
rename to examples/examples/relighting/02dac14fc596c51077015d280ea564faa1f735b5_Left.jpg
diff --git a/demo_tasks/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6.jpg b/examples/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6.jpg
rename to examples/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6.jpg
diff --git a/demo_tasks/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6_Left.jpg b/examples/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6_Left.jpg
rename to examples/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6_Left.jpg
diff --git a/demo_tasks/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6_depth.jpg b/examples/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6_depth.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6_depth.jpg
rename to examples/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6_depth.jpg
diff --git a/demo_tasks/examples/relighting/02dafead46f6d59172d8df216c1f5ad11f9899b5.jpg b/examples/examples/relighting/02dafead46f6d59172d8df216c1f5ad11f9899b5.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dafead46f6d59172d8df216c1f5ad11f9899b5.jpg
rename to examples/examples/relighting/02dafead46f6d59172d8df216c1f5ad11f9899b5.jpg
diff --git a/demo_tasks/examples/relighting/02dafead46f6d59172d8df216c1f5ad11f9899b5_Left.jpg b/examples/examples/relighting/02dafead46f6d59172d8df216c1f5ad11f9899b5_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dafead46f6d59172d8df216c1f5ad11f9899b5_Left.jpg
rename to examples/examples/relighting/02dafead46f6d59172d8df216c1f5ad11f9899b5_Left.jpg
diff --git a/demo_tasks/examples/relighting/02db22466eb3bc19d6a10195e1b48fff696c1582.jpg b/examples/examples/relighting/02db22466eb3bc19d6a10195e1b48fff696c1582.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02db22466eb3bc19d6a10195e1b48fff696c1582.jpg
rename to examples/examples/relighting/02db22466eb3bc19d6a10195e1b48fff696c1582.jpg
diff --git a/demo_tasks/examples/relighting/02db22466eb3bc19d6a10195e1b48fff696c1582_Left.jpg b/examples/examples/relighting/02db22466eb3bc19d6a10195e1b48fff696c1582_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02db22466eb3bc19d6a10195e1b48fff696c1582_Left.jpg
rename to examples/examples/relighting/02db22466eb3bc19d6a10195e1b48fff696c1582_Left.jpg
diff --git a/demo_tasks/examples/relighting/02db31cb32e74620523955b70807b3e11815451c.jpg b/examples/examples/relighting/02db31cb32e74620523955b70807b3e11815451c.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02db31cb32e74620523955b70807b3e11815451c.jpg
rename to examples/examples/relighting/02db31cb32e74620523955b70807b3e11815451c.jpg
diff --git a/demo_tasks/examples/relighting/02db31cb32e74620523955b70807b3e11815451c_Left.jpg b/examples/examples/relighting/02db31cb32e74620523955b70807b3e11815451c_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02db31cb32e74620523955b70807b3e11815451c_Left.jpg
rename to examples/examples/relighting/02db31cb32e74620523955b70807b3e11815451c_Left.jpg
diff --git a/demo_tasks/examples/relighting/02db31cb32e74620523955b70807b3e11815451c_depth.jpg b/examples/examples/relighting/02db31cb32e74620523955b70807b3e11815451c_depth.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02db31cb32e74620523955b70807b3e11815451c_depth.jpg
rename to examples/examples/relighting/02db31cb32e74620523955b70807b3e11815451c_depth.jpg
diff --git a/demo_tasks/examples/relighting/02db5a81c222483058fecd76d62c5f7246b06ee4.jpg b/examples/examples/relighting/02db5a81c222483058fecd76d62c5f7246b06ee4.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02db5a81c222483058fecd76d62c5f7246b06ee4.jpg
rename to examples/examples/relighting/02db5a81c222483058fecd76d62c5f7246b06ee4.jpg
diff --git a/demo_tasks/examples/relighting/02db5a81c222483058fecd76d62c5f7246b06ee4_Left.jpg b/examples/examples/relighting/02db5a81c222483058fecd76d62c5f7246b06ee4_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02db5a81c222483058fecd76d62c5f7246b06ee4_Left.jpg
rename to examples/examples/relighting/02db5a81c222483058fecd76d62c5f7246b06ee4_Left.jpg
diff --git a/demo_tasks/examples/relighting/02db80670789cc6722f78747cf6ab8c292a898ab.jpg b/examples/examples/relighting/02db80670789cc6722f78747cf6ab8c292a898ab.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02db80670789cc6722f78747cf6ab8c292a898ab.jpg
rename to examples/examples/relighting/02db80670789cc6722f78747cf6ab8c292a898ab.jpg
diff --git a/demo_tasks/examples/relighting/02db80670789cc6722f78747cf6ab8c292a898ab_Left.jpg b/examples/examples/relighting/02db80670789cc6722f78747cf6ab8c292a898ab_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02db80670789cc6722f78747cf6ab8c292a898ab_Left.jpg
rename to examples/examples/relighting/02db80670789cc6722f78747cf6ab8c292a898ab_Left.jpg
diff --git a/demo_tasks/examples/relighting/02db8a5f38464943d496bd3b475c36a3d65e7095.jpg b/examples/examples/relighting/02db8a5f38464943d496bd3b475c36a3d65e7095.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02db8a5f38464943d496bd3b475c36a3d65e7095.jpg
rename to examples/examples/relighting/02db8a5f38464943d496bd3b475c36a3d65e7095.jpg
diff --git a/demo_tasks/examples/relighting/02db8a5f38464943d496bd3b475c36a3d65e7095_Left.jpg b/examples/examples/relighting/02db8a5f38464943d496bd3b475c36a3d65e7095_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02db8a5f38464943d496bd3b475c36a3d65e7095_Left.jpg
rename to examples/examples/relighting/02db8a5f38464943d496bd3b475c36a3d65e7095_Left.jpg
diff --git a/demo_tasks/examples/relighting/02db96d3ce2531dc4d51dda52492b78cf3577c56.jpg b/examples/examples/relighting/02db96d3ce2531dc4d51dda52492b78cf3577c56.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02db96d3ce2531dc4d51dda52492b78cf3577c56.jpg
rename to examples/examples/relighting/02db96d3ce2531dc4d51dda52492b78cf3577c56.jpg
diff --git a/demo_tasks/examples/relighting/02db96d3ce2531dc4d51dda52492b78cf3577c56_Left.jpg b/examples/examples/relighting/02db96d3ce2531dc4d51dda52492b78cf3577c56_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02db96d3ce2531dc4d51dda52492b78cf3577c56_Left.jpg
rename to examples/examples/relighting/02db96d3ce2531dc4d51dda52492b78cf3577c56_Left.jpg
diff --git a/demo_tasks/examples/relighting/02dc3e2cf9541a7d7ebff79cbf1fb0d95b4911e8.jpg b/examples/examples/relighting/02dc3e2cf9541a7d7ebff79cbf1fb0d95b4911e8.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dc3e2cf9541a7d7ebff79cbf1fb0d95b4911e8.jpg
rename to examples/examples/relighting/02dc3e2cf9541a7d7ebff79cbf1fb0d95b4911e8.jpg
diff --git a/demo_tasks/examples/relighting/02dc3e2cf9541a7d7ebff79cbf1fb0d95b4911e8_Left.jpg b/examples/examples/relighting/02dc3e2cf9541a7d7ebff79cbf1fb0d95b4911e8_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dc3e2cf9541a7d7ebff79cbf1fb0d95b4911e8_Left.jpg
rename to examples/examples/relighting/02dc3e2cf9541a7d7ebff79cbf1fb0d95b4911e8_Left.jpg
diff --git a/demo_tasks/examples/relighting/02dc42496c4ffdb2a8e101ed82943b26fc2d9d24.jpg b/examples/examples/relighting/02dc42496c4ffdb2a8e101ed82943b26fc2d9d24.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dc42496c4ffdb2a8e101ed82943b26fc2d9d24.jpg
rename to examples/examples/relighting/02dc42496c4ffdb2a8e101ed82943b26fc2d9d24.jpg
diff --git a/demo_tasks/examples/relighting/02dc42496c4ffdb2a8e101ed82943b26fc2d9d24_Left.jpg b/examples/examples/relighting/02dc42496c4ffdb2a8e101ed82943b26fc2d9d24_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dc42496c4ffdb2a8e101ed82943b26fc2d9d24_Left.jpg
rename to examples/examples/relighting/02dc42496c4ffdb2a8e101ed82943b26fc2d9d24_Left.jpg
diff --git a/demo_tasks/examples/relighting/02dc4ebfd90dc80dbc0f4174679ff3828605ec9c.jpg b/examples/examples/relighting/02dc4ebfd90dc80dbc0f4174679ff3828605ec9c.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dc4ebfd90dc80dbc0f4174679ff3828605ec9c.jpg
rename to examples/examples/relighting/02dc4ebfd90dc80dbc0f4174679ff3828605ec9c.jpg
diff --git a/demo_tasks/examples/relighting/02dc4ebfd90dc80dbc0f4174679ff3828605ec9c_Left.jpg b/examples/examples/relighting/02dc4ebfd90dc80dbc0f4174679ff3828605ec9c_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dc4ebfd90dc80dbc0f4174679ff3828605ec9c_Left.jpg
rename to examples/examples/relighting/02dc4ebfd90dc80dbc0f4174679ff3828605ec9c_Left.jpg
diff --git a/demo_tasks/examples/relighting/02dc6ca122863a582306a4f146b7bccb721a49e0.jpg b/examples/examples/relighting/02dc6ca122863a582306a4f146b7bccb721a49e0.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dc6ca122863a582306a4f146b7bccb721a49e0.jpg
rename to examples/examples/relighting/02dc6ca122863a582306a4f146b7bccb721a49e0.jpg
diff --git a/demo_tasks/examples/relighting/02dc6ca122863a582306a4f146b7bccb721a49e0_Left.jpg b/examples/examples/relighting/02dc6ca122863a582306a4f146b7bccb721a49e0_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dc6ca122863a582306a4f146b7bccb721a49e0_Left.jpg
rename to examples/examples/relighting/02dc6ca122863a582306a4f146b7bccb721a49e0_Left.jpg
diff --git a/demo_tasks/examples/relighting/02dca7ccfad757fd596d33563d06b3ab7836d5af.jpg b/examples/examples/relighting/02dca7ccfad757fd596d33563d06b3ab7836d5af.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dca7ccfad757fd596d33563d06b3ab7836d5af.jpg
rename to examples/examples/relighting/02dca7ccfad757fd596d33563d06b3ab7836d5af.jpg
diff --git a/demo_tasks/examples/relighting/02dca7ccfad757fd596d33563d06b3ab7836d5af_Left.jpg b/examples/examples/relighting/02dca7ccfad757fd596d33563d06b3ab7836d5af_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dca7ccfad757fd596d33563d06b3ab7836d5af_Left.jpg
rename to examples/examples/relighting/02dca7ccfad757fd596d33563d06b3ab7836d5af_Left.jpg
diff --git a/demo_tasks/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8.jpg b/examples/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8.jpg
rename to examples/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8.jpg
diff --git a/demo_tasks/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8_Left.jpg b/examples/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8_Left.jpg
rename to examples/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8_Left.jpg
diff --git a/demo_tasks/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8_depth.jpg b/examples/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8_depth.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8_depth.jpg
rename to examples/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8_depth.jpg
diff --git a/demo_tasks/examples/relighting/02dcd82122ffe344c8d7c289dc770febb5121153.jpg b/examples/examples/relighting/02dcd82122ffe344c8d7c289dc770febb5121153.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dcd82122ffe344c8d7c289dc770febb5121153.jpg
rename to examples/examples/relighting/02dcd82122ffe344c8d7c289dc770febb5121153.jpg
diff --git a/demo_tasks/examples/relighting/02dcd82122ffe344c8d7c289dc770febb5121153_Left.jpg b/examples/examples/relighting/02dcd82122ffe344c8d7c289dc770febb5121153_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dcd82122ffe344c8d7c289dc770febb5121153_Left.jpg
rename to examples/examples/relighting/02dcd82122ffe344c8d7c289dc770febb5121153_Left.jpg
diff --git a/demo_tasks/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4.jpg b/examples/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4.jpg
rename to examples/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4.jpg
diff --git a/demo_tasks/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4_Left.jpg b/examples/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4_Left.jpg
rename to examples/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4_Left.jpg
diff --git a/demo_tasks/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4_depth.jpg b/examples/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4_depth.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4_depth.jpg
rename to examples/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4_depth.jpg
diff --git a/demo_tasks/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657.jpg b/examples/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657.jpg
rename to examples/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657.jpg
diff --git a/demo_tasks/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657_Left.jpg b/examples/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657_Left.jpg
rename to examples/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657_Left.jpg
diff --git a/demo_tasks/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657_depth.jpg b/examples/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657_depth.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657_depth.jpg
rename to examples/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657_depth.jpg
diff --git a/demo_tasks/examples/relighting/02dd6a91d0d1d17a9f06e999654b541b555da242.jpg b/examples/examples/relighting/02dd6a91d0d1d17a9f06e999654b541b555da242.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dd6a91d0d1d17a9f06e999654b541b555da242.jpg
rename to examples/examples/relighting/02dd6a91d0d1d17a9f06e999654b541b555da242.jpg
diff --git a/demo_tasks/examples/relighting/02dd6a91d0d1d17a9f06e999654b541b555da242_Left.jpg b/examples/examples/relighting/02dd6a91d0d1d17a9f06e999654b541b555da242_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dd6a91d0d1d17a9f06e999654b541b555da242_Left.jpg
rename to examples/examples/relighting/02dd6a91d0d1d17a9f06e999654b541b555da242_Left.jpg
diff --git a/demo_tasks/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c.jpg b/examples/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c.jpg
rename to examples/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c.jpg
diff --git a/demo_tasks/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c_Left.jpg b/examples/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c_Left.jpg
rename to examples/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c_Left.jpg
diff --git a/demo_tasks/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c_Left_2.jpg b/examples/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c_Left_2.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c_Left_2.jpg
rename to examples/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c_Left_2.jpg
diff --git a/demo_tasks/examples/relighting/02dd79a669a4522f1d5631d75c14243f927848b8.jpg b/examples/examples/relighting/02dd79a669a4522f1d5631d75c14243f927848b8.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dd79a669a4522f1d5631d75c14243f927848b8.jpg
rename to examples/examples/relighting/02dd79a669a4522f1d5631d75c14243f927848b8.jpg
diff --git a/demo_tasks/examples/relighting/02dd79a669a4522f1d5631d75c14243f927848b8_Left.jpg b/examples/examples/relighting/02dd79a669a4522f1d5631d75c14243f927848b8_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dd79a669a4522f1d5631d75c14243f927848b8_Left.jpg
rename to examples/examples/relighting/02dd79a669a4522f1d5631d75c14243f927848b8_Left.jpg
diff --git a/demo_tasks/examples/relighting/02dd9913f85a62d9c1587b00f610cc753ebad649.jpg b/examples/examples/relighting/02dd9913f85a62d9c1587b00f610cc753ebad649.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dd9913f85a62d9c1587b00f610cc753ebad649.jpg
rename to examples/examples/relighting/02dd9913f85a62d9c1587b00f610cc753ebad649.jpg
diff --git a/demo_tasks/examples/relighting/02dd9913f85a62d9c1587b00f610cc753ebad649_Left.jpg b/examples/examples/relighting/02dd9913f85a62d9c1587b00f610cc753ebad649_Left.jpg
similarity index 100%
rename from demo_tasks/examples/relighting/02dd9913f85a62d9c1587b00f610cc753ebad649_Left.jpg
rename to examples/examples/relighting/02dd9913f85a62d9c1587b00f610cc753ebad649_Left.jpg
diff --git a/demo_tasks/examples/tryon/00555_00.jpg b/examples/examples/tryon/00555_00.jpg
similarity index 100%
rename from demo_tasks/examples/tryon/00555_00.jpg
rename to examples/examples/tryon/00555_00.jpg
diff --git a/demo_tasks/examples/tryon/00555_00_tryon_catvton_0.jpg b/examples/examples/tryon/00555_00_tryon_catvton_0.jpg
similarity index 100%
rename from demo_tasks/examples/tryon/00555_00_tryon_catvton_0.jpg
rename to examples/examples/tryon/00555_00_tryon_catvton_0.jpg
diff --git a/demo_tasks/examples/tryon/00700_00.jpg b/examples/examples/tryon/00700_00.jpg
similarity index 100%
rename from demo_tasks/examples/tryon/00700_00.jpg
rename to examples/examples/tryon/00700_00.jpg
diff --git a/demo_tasks/examples/tryon/00700_00_tryon_catvton_0.jpg b/examples/examples/tryon/00700_00_tryon_catvton_0.jpg
similarity index 100%
rename from demo_tasks/examples/tryon/00700_00_tryon_catvton_0.jpg
rename to examples/examples/tryon/00700_00_tryon_catvton_0.jpg
diff --git a/demo_tasks/examples/tryon/03673_00.jpg b/examples/examples/tryon/03673_00.jpg
similarity index 100%
rename from demo_tasks/examples/tryon/03673_00.jpg
rename to examples/examples/tryon/03673_00.jpg
diff --git a/demo_tasks/examples/tryon/12265_00.jpg b/examples/examples/tryon/12265_00.jpg
similarity index 100%
rename from demo_tasks/examples/tryon/12265_00.jpg
rename to examples/examples/tryon/12265_00.jpg
diff --git a/demo_tasks/gradio_tasks.py b/examples/gradio_tasks.py
similarity index 99%
rename from demo_tasks/gradio_tasks.py
rename to examples/gradio_tasks.py
index 453fd16af0a30d577f8918343683f20a48f6fe79..d5945888d20e7f20f77202dd82dd0ac2379c17f6 100644
--- a/demo_tasks/gradio_tasks.py
+++ b/examples/gradio_tasks.py
@@ -15,7 +15,7 @@ def generate_paths_from_id(file_id: str, prompt: str) -> dict:
Returns:
dict: 包含所有生成路径的字典
"""
- base_path = 'demo_tasks/examples'
+ base_path = 'examples/examples'
paths = {
'target': f'{base_path}/{file_id}/{file_id}.jpg',
diff --git a/demo_tasks/gradio_tasks_editing.py b/examples/gradio_tasks_editing.py
similarity index 74%
rename from demo_tasks/gradio_tasks_editing.py
rename to examples/gradio_tasks_editing.py
index 9902eaf214a8dbcde8960b59590d94e657f8ac48..1debb5e461a0e8f75a9e31ffb63dcef381f0428c 100644
--- a/demo_tasks/gradio_tasks_editing.py
+++ b/examples/gradio_tasks_editing.py
@@ -10,10 +10,10 @@ editing = [
dict(
name='add',
images=[
- os.path.join('demo_tasks/examples/omniedit/task_obj_add_273266.jpg'),
- os.path.join('demo_tasks/examples/omniedit/task_obj_add_273266_edit.jpg'),
- os.path.join('demo_tasks/examples/omniedit/task_obj_add_528329.jpg'),
- os.path.join('demo_tasks/examples/omniedit/task_obj_add_528329_edit.jpg'),
+ os.path.join('examples/examples/omniedit/task_obj_add_273266.jpg'),
+ os.path.join('examples/examples/omniedit/task_obj_add_273266_edit.jpg'),
+ os.path.join('examples/examples/omniedit/task_obj_add_528329.jpg'),
+ os.path.join('examples/examples/omniedit/task_obj_add_528329_edit.jpg'),
],
grid_h=2,
grid_w=2,
@@ -23,10 +23,10 @@ editing = [
dict(
name='remove',
images=[
- os.path.join('demo_tasks/examples/omniedit/task_obj_add_528329_edit.jpg'),
- os.path.join('demo_tasks/examples/omniedit/task_obj_add_528329.jpg'),
- os.path.join('demo_tasks/examples/omniedit/task_obj_remove_855511_edit.jpg'),
- os.path.join('demo_tasks/examples/omniedit/task_obj_remove_855511.jpg'),
+ os.path.join('examples/examples/omniedit/task_obj_add_528329_edit.jpg'),
+ os.path.join('examples/examples/omniedit/task_obj_add_528329.jpg'),
+ os.path.join('examples/examples/omniedit/task_obj_remove_855511_edit.jpg'),
+ os.path.join('examples/examples/omniedit/task_obj_remove_855511.jpg'),
],
grid_h=2,
grid_w=2,
diff --git a/demo_tasks/gradio_tasks_editing_subject.py b/examples/gradio_tasks_editing_subject.py
similarity index 57%
rename from demo_tasks/gradio_tasks_editing_subject.py
rename to examples/gradio_tasks_editing_subject.py
index 54976f5082a1323be473ea5255d57731d8909562..33ffeb037e49741817e278385859a314dddecebc 100644
--- a/demo_tasks/gradio_tasks_editing_subject.py
+++ b/examples/gradio_tasks_editing_subject.py
@@ -12,12 +12,12 @@ editing_with_subject = [
examples=[
dict(
images=[
- os.path.join('demo_tasks/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_reference.jpg'),
- os.path.join('demo_tasks/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_qwen_subject_replacement_1737373818845_1.jpg'),
- os.path.join('demo_tasks/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_target.jpg'),
- os.path.join('demo_tasks/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_reference.jpg'),
- os.path.join('demo_tasks/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_qwen_subject_replacement_1737377830929_2.jpg'),
- os.path.join('demo_tasks/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_target.jpg'),
+ os.path.join('examples/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_reference.jpg'),
+ os.path.join('examples/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_qwen_subject_replacement_1737373818845_1.jpg'),
+ os.path.join('examples/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_target.jpg'),
+ os.path.join('examples/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_reference.jpg'),
+ os.path.join('examples/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_qwen_subject_replacement_1737377830929_2.jpg'),
+ os.path.join('examples/examples/graph200k/editing/data-00004-of-00022-5419/data-00004-of-00022-5419_target.jpg'),
],
grid_h=2,
grid_w=3,
@@ -26,12 +26,12 @@ editing_with_subject = [
),
dict(
images=[
- os.path.join('demo_tasks/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_reference.jpg'),
- os.path.join('demo_tasks/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_qwen_subject_replacement_1737373818845_1.jpg'),
- os.path.join('demo_tasks/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_target.jpg'),
- os.path.join('demo_tasks/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_reference.jpg'),
- os.path.join('demo_tasks/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_qwen_subject_replacement_1737410088010_2.jpg'),
- os.path.join('demo_tasks/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_target.jpg'),
+ os.path.join('examples/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_reference.jpg'),
+ os.path.join('examples/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_qwen_subject_replacement_1737373818845_1.jpg'),
+ os.path.join('examples/examples/graph200k/editing/data-00004-of-00022-3633/data-00004-of-00022-3633_target.jpg'),
+ os.path.join('examples/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_reference.jpg'),
+ os.path.join('examples/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_qwen_subject_replacement_1737410088010_2.jpg'),
+ os.path.join('examples/examples/graph200k/editing/data-00012-of-00022-8475/data-00012-of-00022-8475_target.jpg'),
],
grid_h=2,
grid_w=3,
diff --git a/demo_tasks/gradio_tasks_photodoodle.py b/examples/gradio_tasks_photodoodle.py
similarity index 63%
rename from demo_tasks/gradio_tasks_photodoodle.py
rename to examples/gradio_tasks_photodoodle.py
index 8b486e20597da75956064823f8cbc3b191a5efc6..defc61e35c62e31227b8c5d358e559df426e09f0 100644
--- a/demo_tasks/gradio_tasks_photodoodle.py
+++ b/examples/gradio_tasks_photodoodle.py
@@ -10,12 +10,12 @@ photodoodle = [
dict(
name='sksmonstercalledlulu',
images=[
- os.path.join('demo_tasks/examples/photodoodle/sksmonstercalledlulu/5.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/sksmonstercalledlulu/5_blend.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/sksmonstercalledlulu/6.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/sksmonstercalledlulu/6_blend.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/sksmonstercalledlulu/9.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/sksmonstercalledlulu/9_blend.jpg'),
+ os.path.join('examples/examples/photodoodle/sksmonstercalledlulu/5.jpg'),
+ os.path.join('examples/examples/photodoodle/sksmonstercalledlulu/5_blend.jpg'),
+ os.path.join('examples/examples/photodoodle/sksmonstercalledlulu/6.jpg'),
+ os.path.join('examples/examples/photodoodle/sksmonstercalledlulu/6_blend.jpg'),
+ os.path.join('examples/examples/photodoodle/sksmonstercalledlulu/9.jpg'),
+ os.path.join('examples/examples/photodoodle/sksmonstercalledlulu/9_blend.jpg'),
],
grid_h=3,
grid_w=2,
@@ -25,12 +25,12 @@ photodoodle = [
dict(
name='skspaintingeffects',
images=[
- os.path.join('demo_tasks/examples/photodoodle/skspaintingeffects/12.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/skspaintingeffects/12_blend.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/skspaintingeffects/35.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/skspaintingeffects/35_blend.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/skspaintingeffects/37.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/skspaintingeffects/37_blend.jpg'),
+ os.path.join('examples/examples/photodoodle/skspaintingeffects/12.jpg'),
+ os.path.join('examples/examples/photodoodle/skspaintingeffects/12_blend.jpg'),
+ os.path.join('examples/examples/photodoodle/skspaintingeffects/35.jpg'),
+ os.path.join('examples/examples/photodoodle/skspaintingeffects/35_blend.jpg'),
+ os.path.join('examples/examples/photodoodle/skspaintingeffects/37.jpg'),
+ os.path.join('examples/examples/photodoodle/skspaintingeffects/37_blend.jpg'),
],
grid_h=3,
grid_w=2,
@@ -40,12 +40,12 @@ photodoodle = [
dict(
name='sksmagiceffects',
images=[
- os.path.join('demo_tasks/examples/photodoodle/sksmagiceffects/29.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/sksmagiceffects/29_blend.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/sksmagiceffects/50.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/sksmagiceffects/50_blend.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/sksmagiceffects/24.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/sksmagiceffects/24_blend.jpg'),
+ os.path.join('examples/examples/photodoodle/sksmagiceffects/29.jpg'),
+ os.path.join('examples/examples/photodoodle/sksmagiceffects/29_blend.jpg'),
+ os.path.join('examples/examples/photodoodle/sksmagiceffects/50.jpg'),
+ os.path.join('examples/examples/photodoodle/sksmagiceffects/50_blend.jpg'),
+ os.path.join('examples/examples/photodoodle/sksmagiceffects/24.jpg'),
+ os.path.join('examples/examples/photodoodle/sksmagiceffects/24_blend.jpg'),
],
grid_h=3,
grid_w=2,
@@ -55,10 +55,10 @@ photodoodle = [
dict(
name='sksedgeeffect',
images=[
- os.path.join('demo_tasks/examples/photodoodle/sksedgeeffect/34.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/sksedgeeffect/34_blend.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/sksedgeeffect/1.jpg'),
- os.path.join('demo_tasks/examples/photodoodle/sksedgeeffect/1_blend.jpg'),
+ os.path.join('examples/examples/photodoodle/sksedgeeffect/34.jpg'),
+ os.path.join('examples/examples/photodoodle/sksedgeeffect/34_blend.jpg'),
+ os.path.join('examples/examples/photodoodle/sksedgeeffect/1.jpg'),
+ os.path.join('examples/examples/photodoodle/sksedgeeffect/1_blend.jpg'),
],
grid_h=2,
grid_w=2,
diff --git a/examples/gradio_tasks_relighting.py b/examples/gradio_tasks_relighting.py
new file mode 100644
index 0000000000000000000000000000000000000000..1e195e16d22e254662d1553fe7489d99c4ef0ca7
--- /dev/null
+++ b/examples/gradio_tasks_relighting.py
@@ -0,0 +1,239 @@
+import os
+from data.prefix_instruction import get_image_prompt, get_task_instruction, get_layout_instruction, get_content_instruction
+import random
+from PIL import Image
+
+
+task_instruction = "Each row shows a process to manipulate the illumination of images and changes the background following the instruction."
+content_instruction = "In the last row, the illumination comes from left side of the image, with changed background and style as "
+relighting = [
+ dict(
+ name='sunset over sea',
+ images=[
+ os.path.join('examples/examples/relighting/02daa50ac59bb9eabcbe0d5304af880d941bffc3.jpg'),
+ os.path.join('examples/examples/relighting/02daa50ac59bb9eabcbe0d5304af880d941bffc3_Left.jpg'),
+ os.path.join('examples/examples/relighting/02db8a5f38464943d496bd3b475c36a3d65e7095.jpg'),
+ os.path.join('examples/examples/relighting/02db8a5f38464943d496bd3b475c36a3d65e7095_Left.jpg'),
+ os.path.join('examples/examples/relighting/02db96d3ce2531dc4d51dda52492b78cf3577c56.jpg'),
+ os.path.join('examples/examples/relighting/02db96d3ce2531dc4d51dda52492b78cf3577c56_Left.jpg'),
+ ],
+ grid_h=3,
+ grid_w=2,
+ task_prompt=task_instruction,
+ content_prompt=content_instruction + "sunset over sea.",
+ ),
+ dict(
+ name='light and shadow',
+ images=[
+ os.path.join('examples/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6.jpg'),
+ os.path.join('examples/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6_Left.jpg'),
+ os.path.join('examples/examples/relighting/02db31cb32e74620523955b70807b3e11815451c.jpg'),
+ os.path.join('examples/examples/relighting/02db31cb32e74620523955b70807b3e11815451c_Left.jpg'),
+ os.path.join('examples/examples/relighting/02dcd82122ffe344c8d7c289dc770febb5121153.jpg'),
+ os.path.join('examples/examples/relighting/02dcd82122ffe344c8d7c289dc770febb5121153_Left.jpg'),
+ ],
+ grid_h=3,
+ grid_w=2,
+ task_prompt=task_instruction,
+ content_prompt=content_instruction + "light and shadow.",
+ ),
+ dict(
+ name='sci-fi RGB glowing, cyberpunkw',
+ images=[
+ os.path.join('examples/examples/relighting/02db5a81c222483058fecd76d62c5f7246b06ee4.jpg'),
+ os.path.join('examples/examples/relighting/02db5a81c222483058fecd76d62c5f7246b06ee4_Left.jpg'),
+ os.path.join('examples/examples/relighting/02db80670789cc6722f78747cf6ab8c292a898ab.jpg'),
+ os.path.join('examples/examples/relighting/02db80670789cc6722f78747cf6ab8c292a898ab_Left.jpg'),
+ os.path.join('examples/examples/relighting/02dc3e2cf9541a7d7ebff79cbf1fb0d95b4911e8.jpg'),
+ os.path.join('examples/examples/relighting/02dc3e2cf9541a7d7ebff79cbf1fb0d95b4911e8_Left.jpg'),
+ ],
+ grid_h=3,
+ grid_w=2,
+ task_prompt=task_instruction,
+ content_prompt=content_instruction + "sci-fi RGB glowing, cyberpunk.",
+ ),
+ dict(
+ name='golden time',
+ images=[
+ os.path.join('examples/examples/relighting/02dc6ca122863a582306a4f146b7bccb721a49e0.jpg'),
+ os.path.join('examples/examples/relighting/02dc6ca122863a582306a4f146b7bccb721a49e0_Left.jpg'),
+ os.path.join('examples/examples/relighting/02dc4ebfd90dc80dbc0f4174679ff3828605ec9c.jpg'),
+ os.path.join('examples/examples/relighting/02dc4ebfd90dc80dbc0f4174679ff3828605ec9c_Left.jpg'),
+ os.path.join('examples/examples/relighting/02dca7ccfad757fd596d33563d06b3ab7836d5af.jpg'),
+ os.path.join('examples/examples/relighting/02dca7ccfad757fd596d33563d06b3ab7836d5af_Left.jpg'),
+ ],
+ grid_h=3,
+ grid_w=2,
+ task_prompt=task_instruction,
+ content_prompt=content_instruction + "golden time.",
+ ),
+ dict(
+ name='shadow from window',
+ images=[
+ os.path.join('examples/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657.jpg'),
+ os.path.join('examples/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657_Left.jpg'),
+ os.path.join('examples/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8.jpg'),
+ os.path.join('examples/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8_Left.jpg'),
+ os.path.join('examples/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4.jpg'),
+ os.path.join('examples/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4_Left.jpg'),
+ ],
+ grid_h=3,
+ grid_w=2,
+ task_prompt=task_instruction,
+ content_prompt=content_instruction + "shadow from window.",
+ ),
+ dict(
+ name='soft studio lighting',
+ images=[
+ os.path.join('examples/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c.jpg'),
+ os.path.join('examples/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c_Left.jpg'),
+ os.path.join('examples/examples/relighting/02dd6a91d0d1d17a9f06e999654b541b555da242.jpg'),
+ os.path.join('examples/examples/relighting/02dd6a91d0d1d17a9f06e999654b541b555da242_Left.jpg'),
+ ],
+ grid_h=2,
+ grid_w=2,
+ task_prompt=task_instruction,
+ content_prompt=content_instruction + "soft studio lighting.",
+ ),
+ dict(
+ name='evil, gothic, Yharnam',
+ images=[
+ os.path.join('examples/examples/relighting/02aee2a8df8f6e6f16ca4ec278203543656cecf1.jpg'),
+ os.path.join('examples/examples/relighting/02aee2a8df8f6e6f16ca4ec278203543656cecf1_Left.jpg'),
+ os.path.join('examples/examples/relighting/02af9925c86c22b379e4e6d4f2762d66966ee281.jpg'),
+ os.path.join('examples/examples/relighting/02af9925c86c22b379e4e6d4f2762d66966ee281_Left.jpg'),
+ os.path.join('examples/examples/relighting/02dd79a669a4522f1d5631d75c14243f927848b8.jpg'),
+ os.path.join('examples/examples/relighting/02dd79a669a4522f1d5631d75c14243f927848b8_Left.jpg'),
+ ],
+ grid_h=3,
+ grid_w=2,
+ task_prompt=task_instruction,
+ content_prompt=content_instruction + "evil, gothic, Yharnam.",
+ ),
+ dict(
+ name='neon, Wong Kar-wai, warm',
+ images=[
+ os.path.join('examples/examples/relighting/02af99b6765a77a8f2ac87aa42d2f2453dcd590f.jpg'),
+ os.path.join('examples/examples/relighting/02af99b6765a77a8f2ac87aa42d2f2453dcd590f_Left.jpg'),
+ os.path.join('examples/examples/relighting/02b02e2916bf2eb3608f5a806dc3b7ecbed3b649.jpg'),
+ os.path.join('examples/examples/relighting/02b02e2916bf2eb3608f5a806dc3b7ecbed3b649_Left.jpg'),
+ os.path.join('examples/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010.jpg'),
+ os.path.join('examples/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010_Left.jpg'),
+ ],
+ grid_h=3,
+ grid_w=2,
+ task_prompt=task_instruction,
+ content_prompt=content_instruction + "neon, Wong Kar-wai, warm.",
+ ),
+ dict(
+ name='home atmosphere, cozy bedroom illumination',
+ images=[
+ os.path.join('examples/examples/relighting/02db22466eb3bc19d6a10195e1b48fff696c1582.jpg'),
+ os.path.join('examples/examples/relighting/02db22466eb3bc19d6a10195e1b48fff696c1582_Left.jpg'),
+ os.path.join('examples/examples/relighting/02c3760bf08f00d9e2163248e2864f5e1a70d709.jpg'),
+ os.path.join('examples/examples/relighting/02c3760bf08f00d9e2163248e2864f5e1a70d709_Left.jpg'),
+ os.path.join('examples/examples/relighting/02af06c41208b31248e94da13166a675c862b003.jpg'),
+ os.path.join('examples/examples/relighting/02af06c41208b31248e94da13166a675c862b003_Left.jpg'),
+ ],
+ grid_h=3,
+ grid_w=2,
+ task_prompt=task_instruction,
+ content_prompt=content_instruction + "home atmosphere, cozy bedroom illumination.",
+ ),
+ dict(
+ name='warm atmosphere, at home, bedroom',
+ images=[
+ os.path.join('examples/examples/relighting/02c39e8e82f4be91d24252c8bfbfdef033ec8a32.jpg'),
+ os.path.join('examples/examples/relighting/02c39e8e82f4be91d24252c8bfbfdef033ec8a32_Left.jpg'),
+ os.path.join('examples/examples/relighting/02c5200cac1d0f19256232a09708ac47f6ddfab3.jpg'),
+ os.path.join('examples/examples/relighting/02c5200cac1d0f19256232a09708ac47f6ddfab3_Left.jpg'),
+ os.path.join('examples/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c.jpg'),
+ os.path.join('examples/examples/relighting/02dd6f77ccab6d63e7f2d7795f5d03180b46621c_Left_2.jpg'),
+ ],
+ grid_h=3,
+ grid_w=2,
+ task_prompt=task_instruction,
+ content_prompt=content_instruction + "warm atmosphere, at home, bedroom.",
+ ),
+ dict(
+ name='natural lighting',
+ images=[
+ os.path.join('examples/examples/relighting/02dafead46f6d59172d8df216c1f5ad11f9899b5.jpg'),
+ os.path.join('examples/examples/relighting/02dafead46f6d59172d8df216c1f5ad11f9899b5_Left.jpg'),
+ os.path.join('examples/examples/relighting/02dc42496c4ffdb2a8e101ed82943b26fc2d9d24.jpg'),
+ os.path.join('examples/examples/relighting/02dc42496c4ffdb2a8e101ed82943b26fc2d9d24_Left.jpg'),
+ ],
+ grid_h=2,
+ grid_w=2,
+ task_prompt=task_instruction,
+ content_prompt=content_instruction + "natural lighting.",
+ ),
+ dict(
+ name='magic lit',
+ images=[
+ os.path.join('examples/examples/relighting/02dd9913f85a62d9c1587b00f610cc753ebad649.jpg'),
+ os.path.join('examples/examples/relighting/02dd9913f85a62d9c1587b00f610cc753ebad649_Left.jpg'),
+ os.path.join('examples/examples/relighting/02afbcf084a1e35bda34c26d2271d56b6a1c621e.jpg'),
+ os.path.join('examples/examples/relighting/02afbcf084a1e35bda34c26d2271d56b6a1c621e_Left.jpg'),
+ ],
+ grid_h=2,
+ grid_w=2,
+ task_prompt=task_instruction,
+ content_prompt=content_instruction + "magic lit.",
+ ),
+ dict(
+ name='sunshine from window',
+ images=[
+ os.path.join('examples/examples/relighting/02c53f12ec3d4a9a16d9b0ca3f7773ad2222100c.jpg'),
+ os.path.join('examples/examples/relighting/02c53f12ec3d4a9a16d9b0ca3f7773ad2222100c_Left.jpg'),
+ os.path.join('examples/examples/relighting/02c6c0f92a672110ff86bd12f4aa0d0083c9cf6b.jpg'),
+ os.path.join('examples/examples/relighting/02c6c0f92a672110ff86bd12f4aa0d0083c9cf6b_Left.jpg'),
+ os.path.join('examples/examples/relighting/02c5cc03d46ce15494caaf3d65a2b2c7e09089f2.jpg'),
+ os.path.join('examples/examples/relighting/02c5cc03d46ce15494caaf3d65a2b2c7e09089f2_Left.jpg'),
+ ],
+ grid_h=3,
+ grid_w=2,
+ task_prompt=task_instruction,
+ content_prompt=content_instruction + "sunshine from window.",
+ ),
+ dict(
+ name='neon light, city',
+ images=[
+ os.path.join('examples/examples/relighting/02c7df6c0decd3d542e25089a0af6afe1e070b6a.jpg'),
+ os.path.join('examples/examples/relighting/02c7df6c0decd3d542e25089a0af6afe1e070b6a_Left.jpg'),
+ os.path.join('examples/examples/relighting/02c77b643fbdaec82912634655426553f3d7a537.jpg'),
+ os.path.join('examples/examples/relighting/02c77b643fbdaec82912634655426553f3d7a537_Left.jpg'),
+ os.path.join('examples/examples/relighting/02c73157a981e0ee669ca8125018efbdda1e1483.jpg'),
+ os.path.join('examples/examples/relighting/02c73157a981e0ee669ca8125018efbdda1e1483_Left.jpg'),
+ ],
+ grid_h=3,
+ grid_w=2,
+ task_prompt=task_instruction,
+ content_prompt=content_instruction + "neon light, city.",
+ ),
+]
+relighting_text = [[x['name']] for x in relighting]
+
+
+def process_relighting_tasks(x):
+ for task in relighting:
+ if task['name'] == x[0]:
+ task_prompt = task['task_prompt']
+ content_prompt = task['content_prompt']
+
+ images = task['images']
+ rets = []
+ for image in images:
+ rets.append(Image.open(image))
+
+ grid_h = task['grid_h']
+ grid_w = task['grid_w']
+ mask = task.get('mask', [0 for _ in range(grid_w - 1)] + [1])
+ layout_prompt = get_layout_instruction(grid_w, grid_h)
+
+ upsampling_noise = 0.6
+ steps = 30
+ outputs = [mask, grid_h, grid_w, layout_prompt, task_prompt, content_prompt, upsampling_noise, steps] + rets
+ break
+
+ return outputs
diff --git a/demo_tasks/gradio_tasks_restoration.py b/examples/gradio_tasks_restoration.py
similarity index 97%
rename from demo_tasks/gradio_tasks_restoration.py
rename to examples/gradio_tasks_restoration.py
index 5a84ca75934b72516036a00f1d85e16babf92d0f..8b4648ec85101af37c855b1b767e0a6bbf848e40 100644
--- a/demo_tasks/gradio_tasks_restoration.py
+++ b/examples/gradio_tasks_restoration.py
@@ -3,7 +3,7 @@ from data.prefix_instruction import get_image_prompt, get_task_instruction, get_
import random
from PIL import Image
from .gradio_tasks import dense_prediction_data
-from degradation_utils import add_degradation
+from data.degradation_toolkit.degradation_utils import add_degradation
import numpy as np
diff --git a/demo_tasks/gradio_tasks_style.py b/examples/gradio_tasks_style.py
similarity index 100%
rename from demo_tasks/gradio_tasks_style.py
rename to examples/gradio_tasks_style.py
diff --git a/demo_tasks/gradio_tasks_subject.py b/examples/gradio_tasks_subject.py
similarity index 99%
rename from demo_tasks/gradio_tasks_subject.py
rename to examples/gradio_tasks_subject.py
index 36f333c65a70b41f4649c0eefea710641d70ff98..eec59763d928f77e078d938bced89b6f502c12f2 100644
--- a/demo_tasks/gradio_tasks_subject.py
+++ b/examples/gradio_tasks_subject.py
@@ -2,7 +2,7 @@ import os
from data.prefix_instruction import get_image_prompt, get_task_instruction, get_layout_instruction, get_content_instruction
import random
from PIL import Image
-from degradation_utils import add_degradation
+from data.degradation_toolkit.degradation_utils import add_degradation
import numpy as np
@@ -62,7 +62,7 @@ def generate_paths_from_id(file_id: str, prompt: str) -> dict:
Returns:
dict: 包含所有生成路径的字典
"""
- base_path = 'demo_tasks/examples/graph200k'
+ base_path = 'examples/examples/graph200k'
paths = {
'reference': f'{base_path}/{file_id}/{file_id}_reference.jpg',
diff --git a/demo_tasks/gradio_tasks_tryon.py b/examples/gradio_tasks_tryon.py
similarity index 75%
rename from demo_tasks/gradio_tasks_tryon.py
rename to examples/gradio_tasks_tryon.py
index c783a01b2bbe5ba58559d553c33f506245623aa2..b6a3423d2f32a820a54082bf9549f922e76ca65e 100644
--- a/demo_tasks/gradio_tasks_tryon.py
+++ b/examples/gradio_tasks_tryon.py
@@ -10,12 +10,12 @@ tryon = [
dict(
name='Virtual Try-On',
images=[
- os.path.join('demo_tasks/examples/tryon/00700_00.jpg'),
- os.path.join('demo_tasks/examples/tryon/03673_00.jpg'),
- os.path.join('demo_tasks/examples/tryon/00700_00_tryon_catvton_0.jpg'),
- os.path.join('demo_tasks/examples/tryon/00555_00.jpg'),
- os.path.join('demo_tasks/examples/tryon/12265_00.jpg'),
- os.path.join('demo_tasks/examples/tryon/00555_00_tryon_catvton_0.jpg'),
+ os.path.join('examples/examples/tryon/00700_00.jpg'),
+ os.path.join('examples/examples/tryon/03673_00.jpg'),
+ os.path.join('examples/examples/tryon/00700_00_tryon_catvton_0.jpg'),
+ os.path.join('examples/examples/tryon/00555_00.jpg'),
+ os.path.join('examples/examples/tryon/12265_00.jpg'),
+ os.path.join('examples/examples/tryon/00555_00_tryon_catvton_0.jpg'),
],
grid_h=2,
grid_w=3,
diff --git a/demo_tasks/gradio_tasks_unseen.py b/examples/gradio_tasks_unseen.py
similarity index 87%
rename from demo_tasks/gradio_tasks_unseen.py
rename to examples/gradio_tasks_unseen.py
index f4e2875966e650aa40f30112f9d40a75aa31e7ad..ed6dc1eb43e06cebbf0525bdbe1f369aebb82e67 100644
--- a/demo_tasks/gradio_tasks_unseen.py
+++ b/examples/gradio_tasks_unseen.py
@@ -14,7 +14,7 @@ def generate_paths_from_id(file_id: str, prompt: str) -> dict:
Returns:
dict: 包含所有生成路径的字典
"""
- base_path = 'demo_tasks/examples'
+ base_path = 'examples/examples'
paths = {
'target': f'{base_path}/{file_id}/{file_id}.jpg',
@@ -57,7 +57,7 @@ def generate_paths_from_id(file_id: str, prompt: str) -> dict:
Returns:
dict: 包含所有生成路径的字典
"""
- base_path = 'demo_tasks/examples'
+ base_path = 'examples/examples'
paths = {
'target': f'{base_path}/{file_id}/{file_id}.jpg',
@@ -102,15 +102,15 @@ unseen_tasks = [
examples=[
dict(
images=[
- 'demo_tasks/examples/face/34e1633a-369f-4324-86c3-3e6418ec00be/face_0.jpg',
- 'demo_tasks/examples/face/34e1633a-369f-4324-86c3-3e6418ec00be/face_2.jpg',
- 'demo_tasks/examples/face/34e1633a-369f-4324-86c3-3e6418ec00be/face_1.jpg',
- 'demo_tasks/examples/face/cb5d403a-f1bb-4392-8302-24846893a797/face_0.jpg',
- 'demo_tasks/examples/face/cb5d403a-f1bb-4392-8302-24846893a797/face_2.jpg',
- 'demo_tasks/examples/face/cb5d403a-f1bb-4392-8302-24846893a797/face_1.jpg',
- 'demo_tasks/examples/face/2ef6aa5a-e751-4bf2-a302-0237ab460627/face_8.jpg',
- 'demo_tasks/examples/face/2ef6aa5a-e751-4bf2-a302-0237ab460627/face_6.jpg',
- 'demo_tasks/examples/face/2ef6aa5a-e751-4bf2-a302-0237ab460627/face_1.jpg',
+ 'examples/examples/face/34e1633a-369f-4324-86c3-3e6418ec00be/face_0.jpg',
+ 'examples/examples/face/34e1633a-369f-4324-86c3-3e6418ec00be/face_2.jpg',
+ 'examples/examples/face/34e1633a-369f-4324-86c3-3e6418ec00be/face_1.jpg',
+ 'examples/examples/face/cb5d403a-f1bb-4392-8302-24846893a797/face_0.jpg',
+ 'examples/examples/face/cb5d403a-f1bb-4392-8302-24846893a797/face_2.jpg',
+ 'examples/examples/face/cb5d403a-f1bb-4392-8302-24846893a797/face_1.jpg',
+ 'examples/examples/face/2ef6aa5a-e751-4bf2-a302-0237ab460627/face_8.jpg',
+ 'examples/examples/face/2ef6aa5a-e751-4bf2-a302-0237ab460627/face_6.jpg',
+ 'examples/examples/face/2ef6aa5a-e751-4bf2-a302-0237ab460627/face_1.jpg',
],
grid_h=3,
grid_w=3,
@@ -129,12 +129,12 @@ unseen_tasks = [
examples=[
dict(
images=[
- 'demo_tasks/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6_depth.jpg',
- 'demo_tasks/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6.jpg',
- 'demo_tasks/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6_Left.jpg',
- 'demo_tasks/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010_depth.jpg',
- 'demo_tasks/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010.jpg',
- 'demo_tasks/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010_Left.jpg',
+ 'examples/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6_depth.jpg',
+ 'examples/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6.jpg',
+ 'examples/examples/relighting/02dad6943d2033198a89c1d5f222db2eacb293c6_Left.jpg',
+ 'examples/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010_depth.jpg',
+ 'examples/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010.jpg',
+ 'examples/examples/relighting/02af9fa52ff41e64de8e3212683c9ed43bd91010_Left.jpg',
],
grid_h=2,
grid_w=3,
@@ -144,17 +144,17 @@ unseen_tasks = [
),
dict(
images=[
- 'demo_tasks/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657_depth.jpg',
- 'demo_tasks/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657.jpg',
- 'demo_tasks/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657_Left.jpg',
+ 'examples/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657_depth.jpg',
+ 'examples/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657.jpg',
+ 'examples/examples/relighting/02dd1c7c81e77e22ddba378a121fc371afcc9657_Left.jpg',
#
- 'demo_tasks/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8_depth.jpg',
- 'demo_tasks/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8.jpg',
- 'demo_tasks/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8_Left.jpg',
+ 'examples/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8_depth.jpg',
+ 'examples/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8.jpg',
+ 'examples/examples/relighting/02dcc762ae13127e3975ec043f13342490f61cf8_Left.jpg',
#
- 'demo_tasks/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4_depth.jpg',
- 'demo_tasks/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4.jpg',
- 'demo_tasks/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4_Left.jpg',
+ 'examples/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4_depth.jpg',
+ 'examples/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4.jpg',
+ 'examples/examples/relighting/02dd0f49dceaf611e0173319e26b4e6e1b7a6dd4_Left.jpg',
],
grid_h=3,
grid_w=3,
@@ -169,12 +169,12 @@ unseen_tasks = [
examples=[
dict(
images=[
- 'demo_tasks/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_openpose_fullres_nohand.jpg',
- 'demo_tasks/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_hed_512.jpg',
- 'demo_tasks/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3.jpg',
- 'demo_tasks/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_openpose_fullres_nohand.jpg',
- 'demo_tasks/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_edge.jpg',
- 'demo_tasks/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a.jpg',
+ 'examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_openpose_fullres_nohand.jpg',
+ 'examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3_hed_512.jpg',
+ 'examples/examples/2b74476568f7562a6aa832d423132ed3/2b74476568f7562a6aa832d423132ed3.jpg',
+ 'examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_openpose_fullres_nohand.jpg',
+ 'examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a_edge.jpg',
+ 'examples/examples/78dc6506367d7aa43fe42a898abbfe4a/78dc6506367d7aa43fe42a898abbfe4a.jpg',
],
grid_h=2,
grid_w=3,
@@ -189,12 +189,12 @@ unseen_tasks = [
examples=[
dict(
images=[
- 'demo_tasks/examples/property/1_source.jpg',
- 'demo_tasks/examples/property/1_target.jpg',
- 'demo_tasks/examples/property/2_source.jpg',
- 'demo_tasks/examples/property/2_target.jpg',
- 'demo_tasks/examples/property/3_source.jpg',
- 'demo_tasks/examples/property/3_target.jpg',
+ 'examples/examples/property/1_source.jpg',
+ 'examples/examples/property/1_target.jpg',
+ 'examples/examples/property/2_source.jpg',
+ 'examples/examples/property/2_target.jpg',
+ 'examples/examples/property/3_source.jpg',
+ 'examples/examples/property/3_target.jpg',
],
grid_h=3,
grid_w=2,
@@ -209,12 +209,12 @@ unseen_tasks = [
examples=[
dict(
images=[
- 'demo_tasks/examples/env/1_source.jpg',
- 'demo_tasks/examples/env/1_target.jpg',
- 'demo_tasks/examples/env/2_source.jpg',
- 'demo_tasks/examples/env/2_target.jpg',
- 'demo_tasks/examples/env/3_source.jpg',
- 'demo_tasks/examples/env/3_target.jpg',
+ 'examples/examples/env/1_source.jpg',
+ 'examples/examples/env/1_target.jpg',
+ 'examples/examples/env/2_source.jpg',
+ 'examples/examples/env/2_target.jpg',
+ 'examples/examples/env/3_source.jpg',
+ 'examples/examples/env/3_target.jpg',
],
grid_h=3,
grid_w=2,
diff --git a/flux/__init__.py b/flux/__init__.py
deleted file mode 100644
index dddc6a38b801798e6675dea1498e32ffbc8c39ab..0000000000000000000000000000000000000000
--- a/flux/__init__.py
+++ /dev/null
@@ -1,13 +0,0 @@
-try:
- from ._version import (
- version as __version__, # type: ignore
- version_tuple,
- )
-except ImportError:
- __version__ = "unknown (no version information available)"
- version_tuple = (0, 0, "unknown", "noinfo")
-
-from pathlib import Path
-
-PACKAGE = __package__.replace("_", "-")
-PACKAGE_ROOT = Path(__file__).parent
diff --git a/flux/__main__.py b/flux/__main__.py
deleted file mode 100644
index d5cf0fd2444d4cda4053fa74dad3371556b886e5..0000000000000000000000000000000000000000
--- a/flux/__main__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-from .cli import app
-
-if __name__ == "__main__":
- app()
diff --git a/flux/api.py b/flux/api.py
deleted file mode 100644
index 6a60884012e66a944b18683a5d3d100828c5b1b9..0000000000000000000000000000000000000000
--- a/flux/api.py
+++ /dev/null
@@ -1,225 +0,0 @@
-import io
-import os
-import time
-from pathlib import Path
-
-import requests
-from PIL import Image
-
-API_URL = "https://api.bfl.ml"
-API_ENDPOINTS = {
- "flux.1-pro": "flux-pro",
- "flux.1-dev": "flux-dev",
- "flux.1.1-pro": "flux-pro-1.1",
-}
-
-
-class ApiException(Exception):
- def __init__(self, status_code: int, detail: str | list[dict] | None = None):
- super().__init__()
- self.detail = detail
- self.status_code = status_code
-
- def __str__(self) -> str:
- return self.__repr__()
-
- def __repr__(self) -> str:
- if self.detail is None:
- message = None
- elif isinstance(self.detail, str):
- message = self.detail
- else:
- message = "[" + ",".join(d["msg"] for d in self.detail) + "]"
- return f"ApiException({self.status_code=}, {message=}, detail={self.detail})"
-
-
-class ImageRequest:
- def __init__(
- self,
- # api inputs
- prompt: str,
- name: str = "flux.1.1-pro",
- width: int | None = None,
- height: int | None = None,
- num_steps: int | None = None,
- prompt_upsampling: bool | None = None,
- seed: int | None = None,
- guidance: float | None = None,
- interval: float | None = None,
- safety_tolerance: int | None = None,
- # behavior of this class
- validate: bool = True,
- launch: bool = True,
- api_key: str | None = None,
- ):
- """
- Manages an image generation request to the API.
-
- All parameters not specified will use the API defaults.
-
- Args:
- prompt: Text prompt for image generation.
- width: Width of the generated image in pixels. Must be a multiple of 32.
- height: Height of the generated image in pixels. Must be a multiple of 32.
- name: Which model version to use
- num_steps: Number of steps for the image generation process.
- prompt_upsampling: Whether to perform upsampling on the prompt.
- seed: Optional seed for reproducibility.
- guidance: Guidance scale for image generation.
- safety_tolerance: Tolerance level for input and output moderation.
- Between 0 and 6, 0 being most strict, 6 being least strict.
- validate: Run input validation
- launch: Directly launches request
- api_key: Your API key if not provided by the environment
-
- Raises:
- ValueError: For invalid input, when `validate`
- ApiException: For errors raised from the API
- """
- if validate:
- if name not in API_ENDPOINTS.keys():
- raise ValueError(f"Invalid model {name}")
- elif width is not None and width % 32 != 0:
- raise ValueError(f"width must be divisible by 32, got {width}")
- elif width is not None and not (256 <= width <= 1440):
- raise ValueError(f"width must be between 256 and 1440, got {width}")
- elif height is not None and height % 32 != 0:
- raise ValueError(f"height must be divisible by 32, got {height}")
- elif height is not None and not (256 <= height <= 1440):
- raise ValueError(f"height must be between 256 and 1440, got {height}")
- elif num_steps is not None and not (1 <= num_steps <= 50):
- raise ValueError(f"steps must be between 1 and 50, got {num_steps}")
- elif guidance is not None and not (1.5 <= guidance <= 5.0):
- raise ValueError(f"guidance must be between 1.5 and 4, got {guidance}")
- elif interval is not None and not (1.0 <= interval <= 4.0):
- raise ValueError(f"interval must be between 1 and 4, got {interval}")
- elif safety_tolerance is not None and not (0 <= safety_tolerance <= 6.0):
- raise ValueError(f"safety_tolerance must be between 0 and 6, got {interval}")
-
- if name == "flux.1-dev":
- if interval is not None:
- raise ValueError("Interval is not supported for flux.1-dev")
- if name == "flux.1.1-pro":
- if interval is not None or num_steps is not None or guidance is not None:
- raise ValueError("Interval, num_steps and guidance are not supported for " "flux.1.1-pro")
-
- self.name = name
- self.request_json = {
- "prompt": prompt,
- "width": width,
- "height": height,
- "steps": num_steps,
- "prompt_upsampling": prompt_upsampling,
- "seed": seed,
- "guidance": guidance,
- "interval": interval,
- "safety_tolerance": safety_tolerance,
- }
- self.request_json = {key: value for key, value in self.request_json.items() if value is not None}
-
- self.request_id: str | None = None
- self.result: dict | None = None
- self._image_bytes: bytes | None = None
- self._url: str | None = None
- if api_key is None:
- self.api_key = os.environ.get("BFL_API_KEY")
- else:
- self.api_key = api_key
-
- if launch:
- self.request()
-
- def request(self):
- """
- Request to generate the image.
- """
- if self.request_id is not None:
- return
- response = requests.post(
- f"{API_URL}/v1/{API_ENDPOINTS[self.name]}",
- headers={
- "accept": "application/json",
- "x-key": self.api_key,
- "Content-Type": "application/json",
- },
- json=self.request_json,
- )
- result = response.json()
- if response.status_code != 200:
- raise ApiException(status_code=response.status_code, detail=result.get("detail"))
- self.request_id = response.json()["id"]
-
- def retrieve(self) -> dict:
- """
- Wait for the generation to finish and retrieve response.
- """
- if self.request_id is None:
- self.request()
- while self.result is None:
- response = requests.get(
- f"{API_URL}/v1/get_result",
- headers={
- "accept": "application/json",
- "x-key": self.api_key,
- },
- params={
- "id": self.request_id,
- },
- )
- result = response.json()
- if "status" not in result:
- raise ApiException(status_code=response.status_code, detail=result.get("detail"))
- elif result["status"] == "Ready":
- self.result = result["result"]
- elif result["status"] == "Pending":
- time.sleep(0.5)
- else:
- raise ApiException(status_code=200, detail=f"API returned status '{result['status']}'")
- return self.result
-
- @property
- def bytes(self) -> bytes:
- """
- Generated image as bytes.
- """
- if self._image_bytes is None:
- response = requests.get(self.url)
- if response.status_code == 200:
- self._image_bytes = response.content
- else:
- raise ApiException(status_code=response.status_code)
- return self._image_bytes
-
- @property
- def url(self) -> str:
- """
- Public url to retrieve the image from
- """
- if self._url is None:
- result = self.retrieve()
- self._url = result["sample"]
- return self._url
-
- @property
- def image(self) -> Image.Image:
- """
- Load the image as a PIL Image
- """
- return Image.open(io.BytesIO(self.bytes))
-
- def save(self, path: str):
- """
- Save the generated image to a local path
- """
- suffix = Path(self.url).suffix
- if not path.endswith(suffix):
- path = path + suffix
- Path(path).resolve().parent.mkdir(parents=True, exist_ok=True)
- with open(path, "wb") as file:
- file.write(self.bytes)
-
-
-if __name__ == "__main__":
- from fire import Fire
-
- Fire(ImageRequest)
diff --git a/flux/cli.py b/flux/cli.py
deleted file mode 100644
index e844c765d5e2a969cfff53109ff745b0cb8edf5c..0000000000000000000000000000000000000000
--- a/flux/cli.py
+++ /dev/null
@@ -1,238 +0,0 @@
-import os
-import re
-import time
-from dataclasses import dataclass
-from glob import iglob
-
-import torch
-from fire import Fire
-from transformers import pipeline
-
-from flux.sampling import denoise, get_noise, get_schedule, prepare, unpack
-from flux.util import configs, load_ae, load_clip, load_flow_model, load_t5, save_image
-
-NSFW_THRESHOLD = 0.85
-
-
-@dataclass
-class SamplingOptions:
- prompt: str
- width: int
- height: int
- num_steps: int
- guidance: float
- seed: int | None
-
-
-def parse_prompt(options: SamplingOptions) -> SamplingOptions | None:
- user_question = "Next prompt (write /h for help, /q to quit and leave empty to repeat):\n"
- usage = (
- "Usage: Either write your prompt directly, leave this field empty "
- "to repeat the prompt or write a command starting with a slash:\n"
- "- '/w ' will set the width of the generated image\n"
- "- '/h ' will set the height of the generated image\n"
- "- '/s ' sets the next seed\n"
- "- '/g ' sets the guidance (flux-dev only)\n"
- "- '/n ' sets the number of steps\n"
- "- '/q' to quit"
- )
-
- while (prompt := input(user_question)).startswith("/"):
- if prompt.startswith("/w"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, width = prompt.split()
- options.width = 16 * (int(width) // 16)
- print(
- f"Setting resolution to {options.width} x {options.height} "
- f"({options.height *options.width/1e6:.2f}MP)"
- )
- elif prompt.startswith("/h"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, height = prompt.split()
- options.height = 16 * (int(height) // 16)
- print(
- f"Setting resolution to {options.width} x {options.height} "
- f"({options.height *options.width/1e6:.2f}MP)"
- )
- elif prompt.startswith("/g"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, guidance = prompt.split()
- options.guidance = float(guidance)
- print(f"Setting guidance to {options.guidance}")
- elif prompt.startswith("/s"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, seed = prompt.split()
- options.seed = int(seed)
- print(f"Setting seed to {options.seed}")
- elif prompt.startswith("/n"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, steps = prompt.split()
- options.num_steps = int(steps)
- print(f"Setting number of steps to {options.num_steps}")
- elif prompt.startswith("/q"):
- print("Quitting")
- return None
- else:
- if not prompt.startswith("/h"):
- print(f"Got invalid command '{prompt}'\n{usage}")
- print(usage)
- if prompt != "":
- options.prompt = prompt
- return options
-
-
-@torch.inference_mode()
-def main(
- name: str = "flux-schnell",
- width: int = 1360,
- height: int = 768,
- seed: int | None = None,
- prompt: str = (
- "a photo of a forest with mist swirling around the tree trunks. The word "
- '"FLUX" is painted over it in big, red brush strokes with visible texture'
- ),
- device: str = "cuda" if torch.cuda.is_available() else "cpu",
- num_steps: int | None = None,
- loop: bool = False,
- guidance: float = 3.5,
- offload: bool = False,
- output_dir: str = "output",
- add_sampling_metadata: bool = True,
-):
- """
- Sample the flux model. Either interactively (set `--loop`) or run for a
- single image.
-
- Args:
- name: Name of the model to load
- height: height of the sample in pixels (should be a multiple of 16)
- width: width of the sample in pixels (should be a multiple of 16)
- seed: Set a seed for sampling
- output_name: where to save the output image, `{idx}` will be replaced
- by the index of the sample
- prompt: Prompt used for sampling
- device: Pytorch device
- num_steps: number of sampling steps (default 4 for schnell, 50 for guidance distilled)
- loop: start an interactive session and sample multiple times
- guidance: guidance value used for guidance distillation
- add_sampling_metadata: Add the prompt to the image Exif metadata
- """
- nsfw_classifier = pipeline("image-classification", model="Falconsai/nsfw_image_detection", device=device)
-
- if name not in configs:
- available = ", ".join(configs.keys())
- raise ValueError(f"Got unknown model name: {name}, chose from {available}")
-
- torch_device = torch.device(device)
- if num_steps is None:
- num_steps = 4 if name == "flux-schnell" else 50
-
- # allow for packing and conversion to latent space
- height = 16 * (height // 16)
- width = 16 * (width // 16)
-
- output_name = os.path.join(output_dir, "img_{idx}.jpg")
- if not os.path.exists(output_dir):
- os.makedirs(output_dir)
- idx = 0
- else:
- fns = [fn for fn in iglob(output_name.format(idx="*")) if re.search(r"img_[0-9]+\.jpg$", fn)]
- if len(fns) > 0:
- idx = max(int(fn.split("_")[-1].split(".")[0]) for fn in fns) + 1
- else:
- idx = 0
-
- # init all components
- t5 = load_t5(torch_device, max_length=256 if name == "flux-schnell" else 512)
- clip = load_clip(torch_device)
- model = load_flow_model(name, device="cpu" if offload else torch_device)
- ae = load_ae(name, device="cpu" if offload else torch_device)
-
- rng = torch.Generator(device="cpu")
- opts = SamplingOptions(
- prompt=prompt,
- width=width,
- height=height,
- num_steps=num_steps,
- guidance=guidance,
- seed=seed,
- )
-
- if loop:
- opts = parse_prompt(opts)
-
- while opts is not None:
- if opts.seed is None:
- opts.seed = rng.seed()
- print(f"Generating with seed {opts.seed}:\n{opts.prompt}")
- t0 = time.perf_counter()
-
- # prepare input
- x = get_noise(
- 1,
- opts.height,
- opts.width,
- device=torch_device,
- dtype=torch.bfloat16,
- seed=opts.seed,
- )
- opts.seed = None
- if offload:
- ae = ae.cpu()
- torch.cuda.empty_cache()
- t5, clip = t5.to(torch_device), clip.to(torch_device)
- inp = prepare(t5, clip, x, prompt=opts.prompt)
- timesteps = get_schedule(opts.num_steps, inp["img"].shape[1], shift=(name != "flux-schnell"))
-
- # offload TEs to CPU, load model to gpu
- if offload:
- t5, clip = t5.cpu(), clip.cpu()
- torch.cuda.empty_cache()
- model = model.to(torch_device)
-
- # denoise initial noise
- x = denoise(model, **inp, timesteps=timesteps, guidance=opts.guidance)
-
- # offload model, load autoencoder to gpu
- if offload:
- model.cpu()
- torch.cuda.empty_cache()
- ae.decoder.to(x.device)
-
- # decode latents to pixel space
- x = unpack(x.float(), opts.height, opts.width)
- with torch.autocast(device_type=torch_device.type, dtype=torch.bfloat16):
- x = ae.decode(x)
-
- if torch.cuda.is_available():
- torch.cuda.synchronize()
- t1 = time.perf_counter()
-
- fn = output_name.format(idx=idx)
- print(f"Done in {t1 - t0:.1f}s. Saving {fn}")
-
- idx = save_image(nsfw_classifier, name, output_name, idx, x, add_sampling_metadata, prompt)
-
- if loop:
- print("-" * 80)
- opts = parse_prompt(opts)
- else:
- opts = None
-
-
-def app():
- Fire(main)
-
-
-if __name__ == "__main__":
- app()
diff --git a/flux/cli_control.py b/flux/cli_control.py
deleted file mode 100644
index cd83c89eee13639faa70f3dc2fa616abc5aabb15..0000000000000000000000000000000000000000
--- a/flux/cli_control.py
+++ /dev/null
@@ -1,347 +0,0 @@
-import os
-import re
-import time
-from dataclasses import dataclass
-from glob import iglob
-
-import torch
-from fire import Fire
-from transformers import pipeline
-
-from flux.modules.image_embedders import CannyImageEncoder, DepthImageEncoder
-from flux.sampling import denoise, get_noise, get_schedule, prepare_control, unpack
-from flux.util import configs, load_ae, load_clip, load_flow_model, load_t5, save_image
-
-
-@dataclass
-class SamplingOptions:
- prompt: str
- width: int
- height: int
- num_steps: int
- guidance: float
- seed: int | None
- img_cond_path: str
- lora_scale: float | None
-
-
-def parse_prompt(options: SamplingOptions) -> SamplingOptions | None:
- user_question = "Next prompt (write /h for help, /q to quit and leave empty to repeat):\n"
- usage = (
- "Usage: Either write your prompt directly, leave this field empty "
- "to repeat the prompt or write a command starting with a slash:\n"
- "- '/w ' will set the width of the generated image\n"
- "- '/h ' will set the height of the generated image\n"
- "- '/s ' sets the next seed\n"
- "- '/g ' sets the guidance (flux-dev only)\n"
- "- '/n ' sets the number of steps\n"
- "- '/q' to quit"
- )
-
- while (prompt := input(user_question)).startswith("/"):
- if prompt.startswith("/w"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, width = prompt.split()
- options.width = 16 * (int(width) // 16)
- print(
- f"Setting resolution to {options.width} x {options.height} "
- f"({options.height *options.width/1e6:.2f}MP)"
- )
- elif prompt.startswith("/h"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, height = prompt.split()
- options.height = 16 * (int(height) // 16)
- print(
- f"Setting resolution to {options.width} x {options.height} "
- f"({options.height *options.width/1e6:.2f}MP)"
- )
- elif prompt.startswith("/g"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, guidance = prompt.split()
- options.guidance = float(guidance)
- print(f"Setting guidance to {options.guidance}")
- elif prompt.startswith("/s"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, seed = prompt.split()
- options.seed = int(seed)
- print(f"Setting seed to {options.seed}")
- elif prompt.startswith("/n"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, steps = prompt.split()
- options.num_steps = int(steps)
- print(f"Setting number of steps to {options.num_steps}")
- elif prompt.startswith("/q"):
- print("Quitting")
- return None
- else:
- if not prompt.startswith("/h"):
- print(f"Got invalid command '{prompt}'\n{usage}")
- print(usage)
- if prompt != "":
- options.prompt = prompt
- return options
-
-
-def parse_img_cond_path(options: SamplingOptions | None) -> SamplingOptions | None:
- if options is None:
- return None
-
- user_question = "Next conditioning image (write /h for help, /q to quit and leave empty to repeat):\n"
- usage = (
- "Usage: Either write your prompt directly, leave this field empty "
- "to repeat the conditioning image or write a command starting with a slash:\n"
- "- '/q' to quit"
- )
-
- while True:
- img_cond_path = input(user_question)
-
- if img_cond_path.startswith("/"):
- if img_cond_path.startswith("/q"):
- print("Quitting")
- return None
- else:
- if not img_cond_path.startswith("/h"):
- print(f"Got invalid command '{img_cond_path}'\n{usage}")
- print(usage)
- continue
-
- if img_cond_path == "":
- break
-
- if not os.path.isfile(img_cond_path) or not img_cond_path.lower().endswith(
- (".jpg", ".jpeg", ".png", ".webp")
- ):
- print(f"File '{img_cond_path}' does not exist or is not a valid image file")
- continue
-
- options.img_cond_path = img_cond_path
- break
-
- return options
-
-
-def parse_lora_scale(options: SamplingOptions | None) -> tuple[SamplingOptions | None, bool]:
- changed = False
-
- if options is None:
- return None, changed
-
- user_question = "Next lora scale (write /h for help, /q to quit and leave empty to repeat):\n"
- usage = (
- "Usage: Either write your prompt directly, leave this field empty "
- "to repeat the lora scale or write a command starting with a slash:\n"
- "- '/q' to quit"
- )
-
- while (prompt := input(user_question)).startswith("/"):
- if prompt.startswith("/q"):
- print("Quitting")
- return None, changed
- else:
- if not prompt.startswith("/h"):
- print(f"Got invalid command '{prompt}'\n{usage}")
- print(usage)
- if prompt != "":
- options.lora_scale = float(prompt)
- changed = True
- return options, changed
-
-
-@torch.inference_mode()
-def main(
- name: str,
- width: int = 1024,
- height: int = 1024,
- seed: int | None = None,
- prompt: str = "a robot made out of gold",
- device: str = "cuda" if torch.cuda.is_available() else "cpu",
- num_steps: int = 50,
- loop: bool = False,
- guidance: float | None = None,
- offload: bool = False,
- output_dir: str = "output",
- add_sampling_metadata: bool = True,
- img_cond_path: str = "assets/robot.webp",
- lora_scale: float | None = 0.85,
-):
- """
- Sample the flux model. Either interactively (set `--loop`) or run for a
- single image.
-
- Args:
- height: height of the sample in pixels (should be a multiple of 16)
- width: width of the sample in pixels (should be a multiple of 16)
- seed: Set a seed for sampling
- output_name: where to save the output image, `{idx}` will be replaced
- by the index of the sample
- prompt: Prompt used for sampling
- device: Pytorch device
- num_steps: number of sampling steps (default 4 for schnell, 50 for guidance distilled)
- loop: start an interactive session and sample multiple times
- guidance: guidance value used for guidance distillation
- add_sampling_metadata: Add the prompt to the image Exif metadata
- img_cond_path: path to conditioning image (jpeg/png/webp)
- """
- nsfw_classifier = pipeline("image-classification", model="Falconsai/nsfw_image_detection", device=device)
-
- assert name in [
- "flux-dev-canny",
- "flux-dev-depth",
- "flux-dev-canny-lora",
- "flux-dev-depth-lora",
- ], f"Got unknown model name: {name}"
- if guidance is None:
- if name in ["flux-dev-canny", "flux-dev-canny-lora"]:
- guidance = 30.0
- elif name in ["flux-dev-depth", "flux-dev-depth-lora"]:
- guidance = 10.0
- else:
- raise NotImplementedError()
-
- if name not in configs:
- available = ", ".join(configs.keys())
- raise ValueError(f"Got unknown model name: {name}, chose from {available}")
-
- torch_device = torch.device(device)
-
- output_name = os.path.join(output_dir, "img_{idx}.jpg")
- if not os.path.exists(output_dir):
- os.makedirs(output_dir)
- idx = 0
- else:
- fns = [fn for fn in iglob(output_name.format(idx="*")) if re.search(r"img_[0-9]+\.jpg$", fn)]
- if len(fns) > 0:
- idx = max(int(fn.split("_")[-1].split(".")[0]) for fn in fns) + 1
- else:
- idx = 0
-
- # init all components
- t5 = load_t5(torch_device, max_length=512)
- clip = load_clip(torch_device)
- model = load_flow_model(name, device="cpu" if offload else torch_device)
- ae = load_ae(name, device="cpu" if offload else torch_device)
-
- # set lora scale
- if "lora" in name and lora_scale is not None:
- for _, module in model.named_modules():
- if hasattr(module, "set_scale"):
- module.set_scale(lora_scale)
-
- if name in ["flux-dev-depth", "flux-dev-depth-lora"]:
- img_embedder = DepthImageEncoder(torch_device)
- elif name in ["flux-dev-canny", "flux-dev-canny-lora"]:
- img_embedder = CannyImageEncoder(torch_device)
- else:
- raise NotImplementedError()
-
- rng = torch.Generator(device="cpu")
- opts = SamplingOptions(
- prompt=prompt,
- width=width,
- height=height,
- num_steps=num_steps,
- guidance=guidance,
- seed=seed,
- img_cond_path=img_cond_path,
- lora_scale=lora_scale,
- )
-
- if loop:
- opts = parse_prompt(opts)
- opts = parse_img_cond_path(opts)
- if "lora" in name:
- opts, changed = parse_lora_scale(opts)
- if changed:
- # update the lora scale:
- for _, module in model.named_modules():
- if hasattr(module, "set_scale"):
- module.set_scale(opts.lora_scale)
-
- while opts is not None:
- if opts.seed is None:
- opts.seed = rng.seed()
- print(f"Generating with seed {opts.seed}:\n{opts.prompt}")
- t0 = time.perf_counter()
-
- # prepare input
- x = get_noise(
- 1,
- opts.height,
- opts.width,
- device=torch_device,
- dtype=torch.bfloat16,
- seed=opts.seed,
- )
- opts.seed = None
- if offload:
- t5, clip, ae = t5.to(torch_device), clip.to(torch_device), ae.to(torch_device)
- inp = prepare_control(
- t5,
- clip,
- x,
- prompt=opts.prompt,
- ae=ae,
- encoder=img_embedder,
- img_cond_path=opts.img_cond_path,
- )
- timesteps = get_schedule(opts.num_steps, inp["img"].shape[1], shift=(name != "flux-schnell"))
-
- # offload TEs and AE to CPU, load model to gpu
- if offload:
- t5, clip, ae = t5.cpu(), clip.cpu(), ae.cpu()
- torch.cuda.empty_cache()
- model = model.to(torch_device)
-
- # denoise initial noise
- x = denoise(model, **inp, timesteps=timesteps, guidance=opts.guidance)
-
- # offload model, load autoencoder to gpu
- if offload:
- model.cpu()
- torch.cuda.empty_cache()
- ae.decoder.to(x.device)
-
- # decode latents to pixel space
- x = unpack(x.float(), opts.height, opts.width)
- with torch.autocast(device_type=torch_device.type, dtype=torch.bfloat16):
- x = ae.decode(x)
-
- if torch.cuda.is_available():
- torch.cuda.synchronize()
- t1 = time.perf_counter()
- print(f"Done in {t1 - t0:.1f}s")
-
- idx = save_image(nsfw_classifier, name, output_name, idx, x, add_sampling_metadata, prompt)
-
- if loop:
- print("-" * 80)
- opts = parse_prompt(opts)
- opts = parse_img_cond_path(opts)
- if "lora" in name:
- opts, changed = parse_lora_scale(opts)
- if changed:
- # update the lora scale:
- for _, module in model.named_modules():
- if hasattr(module, "set_scale"):
- module.set_scale(opts.lora_scale)
- else:
- opts = None
-
-
-def app():
- Fire(main)
-
-
-if __name__ == "__main__":
- app()
diff --git a/flux/cli_fill.py b/flux/cli_fill.py
deleted file mode 100644
index 415c04201e6dc13de1e343df43139e4e2ac82065..0000000000000000000000000000000000000000
--- a/flux/cli_fill.py
+++ /dev/null
@@ -1,334 +0,0 @@
-import os
-import re
-import time
-from dataclasses import dataclass
-from glob import iglob
-
-import torch
-from fire import Fire
-from PIL import Image
-from transformers import pipeline
-
-from flux.sampling import denoise, get_noise, get_schedule, prepare_fill, unpack
-from flux.util import configs, load_ae, load_clip, load_flow_model, load_t5, save_image
-
-
-@dataclass
-class SamplingOptions:
- prompt: str
- width: int
- height: int
- num_steps: int
- guidance: float
- seed: int | None
- img_cond_path: str
- img_mask_path: str
-
-
-def parse_prompt(options: SamplingOptions) -> SamplingOptions | None:
- user_question = "Next prompt (write /h for help, /q to quit and leave empty to repeat):\n"
- usage = (
- "Usage: Either write your prompt directly, leave this field empty "
- "to repeat the prompt or write a command starting with a slash:\n"
- "- '/s ' sets the next seed\n"
- "- '/g ' sets the guidance (flux-dev only)\n"
- "- '/n ' sets the number of steps\n"
- "- '/q' to quit"
- )
-
- while (prompt := input(user_question)).startswith("/"):
- if prompt.startswith("/g"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, guidance = prompt.split()
- options.guidance = float(guidance)
- print(f"Setting guidance to {options.guidance}")
- elif prompt.startswith("/s"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, seed = prompt.split()
- options.seed = int(seed)
- print(f"Setting seed to {options.seed}")
- elif prompt.startswith("/n"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, steps = prompt.split()
- options.num_steps = int(steps)
- print(f"Setting number of steps to {options.num_steps}")
- elif prompt.startswith("/q"):
- print("Quitting")
- return None
- else:
- if not prompt.startswith("/h"):
- print(f"Got invalid command '{prompt}'\n{usage}")
- print(usage)
- if prompt != "":
- options.prompt = prompt
- return options
-
-
-def parse_img_cond_path(options: SamplingOptions | None) -> SamplingOptions | None:
- if options is None:
- return None
-
- user_question = "Next conditioning image (write /h for help, /q to quit and leave empty to repeat):\n"
- usage = (
- "Usage: Either write your prompt directly, leave this field empty "
- "to repeat the conditioning image or write a command starting with a slash:\n"
- "- '/q' to quit"
- )
-
- while True:
- img_cond_path = input(user_question)
-
- if img_cond_path.startswith("/"):
- if img_cond_path.startswith("/q"):
- print("Quitting")
- return None
- else:
- if not img_cond_path.startswith("/h"):
- print(f"Got invalid command '{img_cond_path}'\n{usage}")
- print(usage)
- continue
-
- if img_cond_path == "":
- break
-
- if not os.path.isfile(img_cond_path) or not img_cond_path.lower().endswith(
- (".jpg", ".jpeg", ".png", ".webp")
- ):
- print(f"File '{img_cond_path}' does not exist or is not a valid image file")
- continue
- else:
- with Image.open(img_cond_path) as img:
- width, height = img.size
-
- if width % 32 != 0 or height % 32 != 0:
- print(f"Image dimensions must be divisible by 32, got {width}x{height}")
- continue
-
- options.img_cond_path = img_cond_path
- break
-
- return options
-
-
-def parse_img_mask_path(options: SamplingOptions | None) -> SamplingOptions | None:
- if options is None:
- return None
-
- user_question = "Next conditioning mask (write /h for help, /q to quit and leave empty to repeat):\n"
- usage = (
- "Usage: Either write your prompt directly, leave this field empty "
- "to repeat the conditioning mask or write a command starting with a slash:\n"
- "- '/q' to quit"
- )
-
- while True:
- img_mask_path = input(user_question)
-
- if img_mask_path.startswith("/"):
- if img_mask_path.startswith("/q"):
- print("Quitting")
- return None
- else:
- if not img_mask_path.startswith("/h"):
- print(f"Got invalid command '{img_mask_path}'\n{usage}")
- print(usage)
- continue
-
- if img_mask_path == "":
- break
-
- if not os.path.isfile(img_mask_path) or not img_mask_path.lower().endswith(
- (".jpg", ".jpeg", ".png", ".webp")
- ):
- print(f"File '{img_mask_path}' does not exist or is not a valid image file")
- continue
- else:
- with Image.open(img_mask_path) as img:
- width, height = img.size
-
- if width % 32 != 0 or height % 32 != 0:
- print(f"Image dimensions must be divisible by 32, got {width}x{height}")
- continue
- else:
- with Image.open(options.img_cond_path) as img_cond:
- img_cond_width, img_cond_height = img_cond.size
-
- if width != img_cond_width or height != img_cond_height:
- print(
- f"Mask dimensions must match conditioning image, got {width}x{height} and {img_cond_width}x{img_cond_height}"
- )
- continue
-
- options.img_mask_path = img_mask_path
- break
-
- return options
-
-
-@torch.inference_mode()
-def main(
- seed: int | None = None,
- prompt: str = "a white paper cup",
- device: str = "cuda" if torch.cuda.is_available() else "cpu",
- num_steps: int = 50,
- loop: bool = False,
- guidance: float = 30.0,
- offload: bool = False,
- output_dir: str = "output",
- add_sampling_metadata: bool = True,
- img_cond_path: str = "assets/cup.png",
- img_mask_path: str = "assets/cup_mask.png",
-):
- """
- Sample the flux model. Either interactively (set `--loop`) or run for a
- single image. This demo assumes that the conditioning image and mask have
- the same shape and that height and width are divisible by 32.
-
- Args:
- seed: Set a seed for sampling
- output_name: where to save the output image, `{idx}` will be replaced
- by the index of the sample
- prompt: Prompt used for sampling
- device: Pytorch device
- num_steps: number of sampling steps (default 4 for schnell, 50 for guidance distilled)
- loop: start an interactive session and sample multiple times
- guidance: guidance value used for guidance distillation
- add_sampling_metadata: Add the prompt to the image Exif metadata
- img_cond_path: path to conditioning image (jpeg/png/webp)
- img_mask_path: path to conditioning mask (jpeg/png/webp
- """
- nsfw_classifier = pipeline("image-classification", model="Falconsai/nsfw_image_detection", device=device)
-
- name = "flux-dev-fill"
- if name not in configs:
- available = ", ".join(configs.keys())
- raise ValueError(f"Got unknown model name: {name}, chose from {available}")
-
- torch_device = torch.device(device)
-
- output_name = os.path.join(output_dir, "img_{idx}.jpg")
- if not os.path.exists(output_dir):
- os.makedirs(output_dir)
- idx = 0
- else:
- fns = [fn for fn in iglob(output_name.format(idx="*")) if re.search(r"img_[0-9]+\.jpg$", fn)]
- if len(fns) > 0:
- idx = max(int(fn.split("_")[-1].split(".")[0]) for fn in fns) + 1
- else:
- idx = 0
-
- # init all components
- t5 = load_t5(torch_device, max_length=128)
- clip = load_clip(torch_device)
- model = load_flow_model(name, device="cpu" if offload else torch_device)
- ae = load_ae(name, device="cpu" if offload else torch_device)
-
- rng = torch.Generator(device="cpu")
- with Image.open(img_cond_path) as img:
- width, height = img.size
- opts = SamplingOptions(
- prompt=prompt,
- width=width,
- height=height,
- num_steps=num_steps,
- guidance=guidance,
- seed=seed,
- img_cond_path=img_cond_path,
- img_mask_path=img_mask_path,
- )
-
- if loop:
- opts = parse_prompt(opts)
- opts = parse_img_cond_path(opts)
-
- with Image.open(opts.img_cond_path) as img:
- width, height = img.size
- opts.height = height
- opts.width = width
-
- opts = parse_img_mask_path(opts)
-
- while opts is not None:
- if opts.seed is None:
- opts.seed = rng.seed()
- print(f"Generating with seed {opts.seed}:\n{opts.prompt}")
- t0 = time.perf_counter()
-
- # prepare input
- x = get_noise(
- 1,
- opts.height,
- opts.width,
- device=torch_device,
- dtype=torch.bfloat16,
- seed=opts.seed,
- )
- opts.seed = None
- if offload:
- t5, clip, ae = t5.to(torch_device), clip.to(torch_device), ae.to(torch.device)
- inp = prepare_fill(
- t5,
- clip,
- x,
- prompt=opts.prompt,
- ae=ae,
- img_cond_path=opts.img_cond_path,
- mask_path=opts.img_mask_path,
- )
-
- timesteps = get_schedule(opts.num_steps, inp["img"].shape[1], shift=(name != "flux-schnell"))
-
- # offload TEs and AE to CPU, load model to gpu
- if offload:
- t5, clip, ae = t5.cpu(), clip.cpu(), ae.cpu()
- torch.cuda.empty_cache()
- model = model.to(torch_device)
-
- # denoise initial noise
- x = denoise(model, **inp, timesteps=timesteps, guidance=opts.guidance)
-
- # offload model, load autoencoder to gpu
- if offload:
- model.cpu()
- torch.cuda.empty_cache()
- ae.decoder.to(x.device)
-
- # decode latents to pixel space
- x = unpack(x.float(), opts.height, opts.width)
- with torch.autocast(device_type=torch_device.type, dtype=torch.bfloat16):
- x = ae.decode(x)
-
- if torch.cuda.is_available():
- torch.cuda.synchronize()
- t1 = time.perf_counter()
- print(f"Done in {t1 - t0:.1f}s")
-
- idx = save_image(nsfw_classifier, name, output_name, idx, x, add_sampling_metadata, prompt)
-
- if loop:
- print("-" * 80)
- opts = parse_prompt(opts)
- opts = parse_img_cond_path(opts)
-
- with Image.open(opts.img_cond_path) as img:
- width, height = img.size
- opts.height = height
- opts.width = width
-
- opts = parse_img_mask_path(opts)
- else:
- opts = None
-
-
-def app():
- Fire(main)
-
-
-if __name__ == "__main__":
- app()
diff --git a/flux/cli_redux.py b/flux/cli_redux.py
deleted file mode 100644
index 6c03435a2809824905ae5779a89a2ba879cbd03f..0000000000000000000000000000000000000000
--- a/flux/cli_redux.py
+++ /dev/null
@@ -1,279 +0,0 @@
-import os
-import re
-import time
-from dataclasses import dataclass
-from glob import iglob
-
-import torch
-from fire import Fire
-from transformers import pipeline
-
-from flux.modules.image_embedders import ReduxImageEncoder
-from flux.sampling import denoise, get_noise, get_schedule, prepare_redux, unpack
-from flux.util import configs, load_ae, load_clip, load_flow_model, load_t5, save_image
-
-
-@dataclass
-class SamplingOptions:
- prompt: str
- width: int
- height: int
- num_steps: int
- guidance: float
- seed: int | None
- img_cond_path: str
-
-
-def parse_prompt(options: SamplingOptions) -> SamplingOptions | None:
- user_question = "Write /h for help, /q to quit and leave empty to repeat):\n"
- usage = (
- "Usage: Leave this field empty to do nothing "
- "or write a command starting with a slash:\n"
- "- '/w ' will set the width of the generated image\n"
- "- '/h ' will set the height of the generated image\n"
- "- '/s ' sets the next seed\n"
- "- '/g ' sets the guidance (flux-dev only)\n"
- "- '/n ' sets the number of steps\n"
- "- '/q' to quit"
- )
-
- while (prompt := input(user_question)).startswith("/"):
- if prompt.startswith("/w"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, width = prompt.split()
- options.width = 16 * (int(width) // 16)
- print(
- f"Setting resolution to {options.width} x {options.height} "
- f"({options.height *options.width/1e6:.2f}MP)"
- )
- elif prompt.startswith("/h"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, height = prompt.split()
- options.height = 16 * (int(height) // 16)
- print(
- f"Setting resolution to {options.width} x {options.height} "
- f"({options.height *options.width/1e6:.2f}MP)"
- )
- elif prompt.startswith("/g"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, guidance = prompt.split()
- options.guidance = float(guidance)
- print(f"Setting guidance to {options.guidance}")
- elif prompt.startswith("/s"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, seed = prompt.split()
- options.seed = int(seed)
- print(f"Setting seed to {options.seed}")
- elif prompt.startswith("/n"):
- if prompt.count(" ") != 1:
- print(f"Got invalid command '{prompt}'\n{usage}")
- continue
- _, steps = prompt.split()
- options.num_steps = int(steps)
- print(f"Setting number of steps to {options.num_steps}")
- elif prompt.startswith("/q"):
- print("Quitting")
- return None
- else:
- if not prompt.startswith("/h"):
- print(f"Got invalid command '{prompt}'\n{usage}")
- print(usage)
- return options
-
-
-def parse_img_cond_path(options: SamplingOptions | None) -> SamplingOptions | None:
- if options is None:
- return None
-
- user_question = "Next conditioning image (write /h for help, /q to quit and leave empty to repeat):\n"
- usage = (
- "Usage: Either write your prompt directly, leave this field empty "
- "to repeat the conditioning image or write a command starting with a slash:\n"
- "- '/q' to quit"
- )
-
- while True:
- img_cond_path = input(user_question)
-
- if img_cond_path.startswith("/"):
- if img_cond_path.startswith("/q"):
- print("Quitting")
- return None
- else:
- if not img_cond_path.startswith("/h"):
- print(f"Got invalid command '{img_cond_path}'\n{usage}")
- print(usage)
- continue
-
- if img_cond_path == "":
- break
-
- if not os.path.isfile(img_cond_path) or not img_cond_path.lower().endswith(
- (".jpg", ".jpeg", ".png", ".webp")
- ):
- print(f"File '{img_cond_path}' does not exist or is not a valid image file")
- continue
-
- options.img_cond_path = img_cond_path
- break
-
- return options
-
-
-@torch.inference_mode()
-def main(
- name: str = "flux-dev",
- width: int = 1360,
- height: int = 768,
- seed: int | None = None,
- device: str = "cuda" if torch.cuda.is_available() else "cpu",
- num_steps: int | None = None,
- loop: bool = False,
- guidance: float = 2.5,
- offload: bool = False,
- output_dir: str = "output",
- add_sampling_metadata: bool = True,
- img_cond_path: str = "assets/robot.webp",
-):
- """
- Sample the flux model. Either interactively (set `--loop`) or run for a
- single image.
-
- Args:
- name: Name of the model to load
- height: height of the sample in pixels (should be a multiple of 16)
- width: width of the sample in pixels (should be a multiple of 16)
- seed: Set a seed for sampling
- output_name: where to save the output image, `{idx}` will be replaced
- by the index of the sample
- prompt: Prompt used for sampling
- device: Pytorch device
- num_steps: number of sampling steps (default 4 for schnell, 50 for guidance distilled)
- loop: start an interactive session and sample multiple times
- guidance: guidance value used for guidance distillation
- add_sampling_metadata: Add the prompt to the image Exif metadata
- img_cond_path: path to conditioning image (jpeg/png/webp)
- """
- nsfw_classifier = pipeline("image-classification", model="Falconsai/nsfw_image_detection", device=device)
-
- if name not in configs:
- available = ", ".join(configs.keys())
- raise ValueError(f"Got unknown model name: {name}, chose from {available}")
-
- torch_device = torch.device(device)
- if num_steps is None:
- num_steps = 4 if name == "flux-schnell" else 50
-
- output_name = os.path.join(output_dir, "img_{idx}.jpg")
- if not os.path.exists(output_dir):
- os.makedirs(output_dir)
- idx = 0
- else:
- fns = [fn for fn in iglob(output_name.format(idx="*")) if re.search(r"img_[0-9]+\.jpg$", fn)]
- if len(fns) > 0:
- idx = max(int(fn.split("_")[-1].split(".")[0]) for fn in fns) + 1
- else:
- idx = 0
-
- # init all components
- t5 = load_t5(torch_device, max_length=256 if name == "flux-schnell" else 512)
- clip = load_clip(torch_device)
- model = load_flow_model(name, device="cpu" if offload else torch_device)
- ae = load_ae(name, device="cpu" if offload else torch_device)
- img_embedder = ReduxImageEncoder(torch_device)
-
- rng = torch.Generator(device="cpu")
- prompt = ""
- opts = SamplingOptions(
- prompt=prompt,
- width=width,
- height=height,
- num_steps=num_steps,
- guidance=guidance,
- seed=seed,
- img_cond_path=img_cond_path,
- )
-
- if loop:
- opts = parse_prompt(opts)
- opts = parse_img_cond_path(opts)
-
- while opts is not None:
- if opts.seed is None:
- opts.seed = rng.seed()
- print(f"Generating with seed {opts.seed}:\n{opts.prompt}")
- t0 = time.perf_counter()
-
- # prepare input
- x = get_noise(
- 1,
- opts.height,
- opts.width,
- device=torch_device,
- dtype=torch.bfloat16,
- seed=opts.seed,
- )
- opts.seed = None
- if offload:
- ae = ae.cpu()
- torch.cuda.empty_cache()
- t5, clip = t5.to(torch_device), clip.to(torch_device)
- inp = prepare_redux(
- t5,
- clip,
- x,
- prompt=opts.prompt,
- encoder=img_embedder,
- img_cond_path=opts.img_cond_path,
- )
- timesteps = get_schedule(opts.num_steps, inp["img"].shape[1], shift=(name != "flux-schnell"))
-
- # offload TEs to CPU, load model to gpu
- if offload:
- t5, clip = t5.cpu(), clip.cpu()
- torch.cuda.empty_cache()
- model = model.to(torch_device)
-
- # denoise initial noise
- x = denoise(model, **inp, timesteps=timesteps, guidance=opts.guidance)
-
- # offload model, load autoencoder to gpu
- if offload:
- model.cpu()
- torch.cuda.empty_cache()
- ae.decoder.to(x.device)
-
- # decode latents to pixel space
- x = unpack(x.float(), opts.height, opts.width)
- with torch.autocast(device_type=torch_device.type, dtype=torch.bfloat16):
- x = ae.decode(x)
-
- if torch.cuda.is_available():
- torch.cuda.synchronize()
- t1 = time.perf_counter()
- print(f"Done in {t1 - t0:.1f}s")
-
- idx = save_image(nsfw_classifier, name, output_name, idx, x, add_sampling_metadata, prompt)
-
- if loop:
- print("-" * 80)
- opts = parse_prompt(opts)
- opts = parse_img_cond_path(opts)
- else:
- opts = None
-
-
-def app():
- Fire(main)
-
-
-if __name__ == "__main__":
- app()
diff --git a/models/__init__.py b/models/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/flux/math.py b/models/math.py
similarity index 100%
rename from flux/math.py
rename to models/math.py
diff --git a/flux/model.py b/models/model.py
similarity index 98%
rename from flux/model.py
rename to models/model.py
index 1d3ae1acbcced57a1a30e641c18aa8cae9a45bd5..0820cbb4dee64bc199ed904a1632924d97670d18 100644
--- a/flux/model.py
+++ b/models/model.py
@@ -4,7 +4,7 @@ from typing import List
import torch
from torch import Tensor, nn
-from flux.modules.layers import (
+from models.modules.layers import (
DoubleStreamBlock,
EmbedND,
LastLayer,
@@ -12,7 +12,7 @@ from flux.modules.layers import (
SingleStreamBlock,
timestep_embedding,
)
-from flux.modules.lora import LinearLora, replace_linear_with_lora
+from models.modules.lora import LinearLora, replace_linear_with_lora
@dataclass
diff --git a/flux/modules/autoencoder.py b/models/modules/autoencoder.py
similarity index 100%
rename from flux/modules/autoencoder.py
rename to models/modules/autoencoder.py
diff --git a/flux/modules/conditioner.py b/models/modules/conditioner.py
similarity index 100%
rename from flux/modules/conditioner.py
rename to models/modules/conditioner.py
diff --git a/flux/modules/image_embedders.py b/models/modules/image_embedders.py
similarity index 98%
rename from flux/modules/image_embedders.py
rename to models/modules/image_embedders.py
index e7177d2f3cb33f61c6d1b3423c5b2b56dc36ab04..805d9d356e49bb72519d9282b2b6fe76d4ff6f48 100644
--- a/flux/modules/image_embedders.py
+++ b/models/modules/image_embedders.py
@@ -9,7 +9,7 @@ from safetensors.torch import load_file as load_sft
from torch import nn
from transformers import AutoModelForDepthEstimation, AutoProcessor, SiglipImageProcessor, SiglipVisionModel
-from flux.util import print_load_warning
+from models.util import print_load_warning
class DepthImageEncoder:
diff --git a/flux/modules/layers.py b/models/modules/layers.py
similarity index 99%
rename from flux/modules/layers.py
rename to models/modules/layers.py
index a1533887a01377d3e2c9d7f4e0588c1ce56693c3..428d2d0c2b03c1dc06b22f79c930920e55c4f617 100644
--- a/flux/modules/layers.py
+++ b/models/modules/layers.py
@@ -5,7 +5,7 @@ import torch
from einops import rearrange
from torch import Tensor, nn
-from flux.math import attention, rope
+from models.math import attention, rope
class EmbedND(nn.Module):
diff --git a/flux/modules/lora.py b/models/modules/lora.py
similarity index 100%
rename from flux/modules/lora.py
rename to models/modules/lora.py
diff --git a/flux/sampling.py b/models/sampling.py
similarity index 100%
rename from flux/sampling.py
rename to models/sampling.py
diff --git a/flux/util.py b/models/util.py
similarity index 98%
rename from flux/util.py
rename to models/util.py
index 23191494e19abd9f9a19b337619536b475f17972..7985e452fdb8d7d47a9907ea42bc281618f4d4d2 100644
--- a/flux/util.py
+++ b/models/util.py
@@ -7,9 +7,9 @@ from huggingface_hub import hf_hub_download
from PIL import ExifTags, Image
from safetensors.torch import load_file as load_sft
-from flux.model import Flux, FluxLoraWrapper, FluxParams
-from flux.modules.autoencoder import AutoEncoder, AutoEncoderParams
-from flux.modules.conditioner import HFEmbedder
+from models.model import Flux, FluxLoraWrapper, FluxParams
+from models.modules.autoencoder import AutoEncoder, AutoEncoderParams
+from models.modules.conditioner import HFEmbedder
def save_image(
diff --git a/visualcloze.py b/visualcloze.py
index b029ff8760bb2489a85b15c46909783847e83146..67940f5998cf9172c38fbd22d73aa3a3e70dcb5c 100644
--- a/visualcloze.py
+++ b/visualcloze.py
@@ -7,10 +7,10 @@ import torch
import torch.nn.functional as F
from torchvision import transforms
from torchvision.transforms.functional import to_pil_image
-from flux.sampling import prepare_modified
-from flux.util import load_clip, load_t5, load_flow_model
+from models.sampling import prepare_modified
+from models.util import load_clip, load_t5, load_flow_model
from transport import Sampler, create_transport
-from imgproc import to_rgb_if_rgba
+from data.imgproc import to_rgb_if_rgba
def center_crop(image, target_size):
@@ -91,26 +91,26 @@ class VisualClozeModel:
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
self.dtype = {"bf16": torch.bfloat16, "fp16": torch.float16, "fp32": torch.float32}[self.precision]
- # # Initialize model
- # print("Initializing model...")
- # self.model = load_flow_model(model_name, device=self.device, lora_rank=self.lora_rank)
+ # Initialize model
+ print("Initializing model...")
+ self.model = load_flow_model(model_name, device=self.device, lora_rank=self.lora_rank)
- # # Initialize VAE
- # print("Initializing VAE...")
- # self.ae = AutoencoderKL.from_pretrained(f"black-forest-labs/FLUX.1-dev", subfolder="vae", torch_dtype=self.dtype).to(self.device)
- # self.ae.requires_grad_(False)
+ # Initialize VAE
+ print("Initializing VAE...")
+ self.ae = AutoencoderKL.from_pretrained(f"black-forest-labs/FLUX.1-dev", subfolder="vae", torch_dtype=self.dtype).to(self.device)
+ self.ae.requires_grad_(False)
- # # Initialize text encoders
- # print("Initializing text encoders...")
- # self.t5 = load_t5(self.device, max_length=self.max_length)
- # self.clip = load_clip(self.device)
+ # Initialize text encoders
+ print("Initializing text encoders...")
+ self.t5 = load_t5(self.device, max_length=self.max_length)
+ self.clip = load_clip(self.device)
- # self.model.eval().to(self.device, dtype=self.dtype)
+ self.model.eval().to(self.device, dtype=self.dtype)
- # # Load model weights
- # ckpt = torch.load(model_path)
- # self.model.load_state_dict(ckpt, strict=False)
- # del ckpt
+ # Load model weights
+ ckpt = torch.load(model_path)
+ self.model.load_state_dict(ckpt, strict=False)
+ del ckpt
# Initialize sampler
transport = create_transport(
@@ -177,6 +177,10 @@ class VisualClozeModel:
new_h = int((target_area / aspect_ratio) ** 0.5)
new_w = int(new_h * aspect_ratio)
target_size = (new_w, new_h)
+
+ image = image.resize(((target_size[0] // 16) * 16, (target_size[1] // 16) * 16))
+ if upsampling_noise >= 1.0:
+ return image
self.sample_fn = self.sampler.sample_ode(
sampling_method=self.solver,
@@ -188,10 +192,7 @@ class VisualClozeModel:
time_shifting_factor=1.0,
strength=upsampling_noise
)
-
- image = image.resize(((target_size[0] // 16) * 16, (target_size[1] // 16) * 16))
- if upsampling_noise >= 1.0:
- return image
+
processed_image = self.image_transform(image)
processed_image = processed_image.to(self.device, non_blocking=True)
blank = torch.zeros_like(processed_image, device=self.device, dtype=self.dtype)
@@ -254,25 +255,28 @@ class VisualClozeModel:
upsampling_noise: float = 0.4,
is_upsampling: bool =True):
"""
- Processes a list of images based on provided text prompts and settings,
- with optional upsampling steps to improve image resolution or detail.
+ Processes a list of images based on the provided text prompts and settings, with optional upsampling to enhance image resolution or detail.
Parameters:
- images (list[list[Image.Image]]): A grid-layout image collection, each row represents an in-context example or the current query,
- where the current query should be placed in the last row.
- The target image can be None in the input. The other images should be the PIL Image class (Image.Image).
- prompts (list[str]): Three prompts, representing the layout prompt, task prompt, and content prompt respectively.
- seed (int): A fixed integer seed to ensure reproducibility of the random elements in the processing.
- cfg (int): The strength of Classifier-Free Diffusion Guidance.
- steps (int): The number of sampling steps.
- upsampling_steps (int): The number of denoising steps when upsampling.
- upsampling_noise (float): When upsampling using SDEdit,
- the noise is used as a starting point and less noise is added the higher the strength.
- A value of 1 means added noise is maximum.
- is_upsampling (bool, optional): A flag to indicate if upsampling should be applied using SDEdit.
+ images (list[list[Image.Image]]): A collection of images arranged in a grid layout, where each row represents an in-context example or the current query.
+ The current query should be placed in the last row. The target image may be None in the input, while all other images should be of the PIL Image type (Image.Image).
+
+ prompts (list[str]): A list containing three prompts: the layout prompt, task prompt, and content prompt, respectively.
+
+ seed (int): A fixed integer seed to ensure reproducibility of random elements during processing.
+
+ cfg (int): The strength of Classifier-Free Diffusion Guidance, which controls the degree of influence over the generated results.
+
+ steps (int): The number of sampling steps to be performed during processing.
+
+ upsampling_steps (int): The number of denoising steps to apply when performing upsampling.
+
+ upsampling_noise (float): The noise level used as a starting point when upsampling with SDEdit. A higher value reduces noise, and setting it to 1 disables SDEdit, causing the PIL resize function to be used instead.
+
+ is_upsampling (bool, optional): A flag indicating whether upsampling should be applied using SDEdit.
Returns:
- Processed images as a result of the algorithm, with optional upsampling applied based on the `is_upsampling` flag.
+ Processed images resulting from the algorithm, with optional upsampling applied based on the `is_upsampling` flag.
"""
if seed == 0:
@@ -342,7 +346,7 @@ class VisualClozeModel:
else:
raise ValueError('Please provide each image in the in-context example.')
- return processed_images
+ # return processed_images
if len(mask_position) > 1 and sum(mask_position) > 1:
if target_size is None:
@@ -446,18 +450,16 @@ class VisualClozeModel:
row_end = grid_h * grid_w
for i in range(row_start, row_end):
# when the image is masked, then output it
- if True: # images[i] is None:
+ if mask_position[i - row_start] and is_upsampling:
cropped = output_images[-1].crop(((i - row_start) * ret_w // self.grid_w, 0, ((i - row_start) + 1) * ret_w // self.grid_w, ret_h))
- ret.append(cropped)
- if mask_position[i - row_start] and is_upsampling and upsampling_noise < 1.0:
- upsampled = self.upsampling(
- cropped,
- upsampling_size,
- cfg,
- upsampling_steps=upsampling_steps,
- upsampling_noise=upsampling_noise,
- generator=rng,
- content_prompt=prompts[2])
- ret.append(upsampled)
+ upsampled = self.upsampling(
+ cropped,
+ upsampling_size,
+ cfg,
+ upsampling_steps=upsampling_steps,
+ upsampling_noise=upsampling_noise,
+ generator=rng,
+ content_prompt=prompts[2])
+ ret.append(upsampled)
return ret
\ No newline at end of file