mirror of
https://github.com/artegoser/image-pluser-webui.git
synced 2024-11-24 04:36:20 +03:00
Compare commits
No commits in common. "a5244a7d4bdc40d60c8a7b7c006ca90282e0f0cc" and "995481f43737fa064de0abf1ee6a5173492037c5" have entirely different histories.
a5244a7d4b
...
995481f437
5 changed files with 4 additions and 47 deletions
|
@ -1,12 +0,0 @@
|
||||||
from skimage.exposure import match_histograms
|
|
||||||
import numpy as np
|
|
||||||
from PIL import Image
|
|
||||||
|
|
||||||
|
|
||||||
def histogram_matching(img1, img2):
|
|
||||||
return Image.fromarray(match_histograms(img1, img2, channel_axis=-1))
|
|
||||||
|
|
||||||
|
|
||||||
methods_funcs = {"Histogram matching": histogram_matching}
|
|
||||||
|
|
||||||
methods = list(methods_funcs.keys())
|
|
|
@ -1,4 +1,6 @@
|
||||||
from methods.stack_methods import methods_funcs
|
from methods.stack_methods import (
|
||||||
|
methods_funcs,
|
||||||
|
)
|
||||||
import os
|
import os
|
||||||
from processing.utils import generate_name
|
from processing.utils import generate_name
|
||||||
|
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
from methods.two_to_one_methods import methods_funcs
|
|
||||||
from processing.utils import generate_name
|
|
||||||
|
|
||||||
|
|
||||||
def two_to_one(img1, img2, method):
|
|
||||||
img = methods_funcs[method](img1, img2)
|
|
||||||
out_path = generate_name(subfolder="two_to_one")
|
|
||||||
img.save(out_path)
|
|
||||||
|
|
||||||
return [out_path]
|
|
|
@ -1,17 +0,0 @@
|
||||||
import gradio as gr
|
|
||||||
from processing.two_to_one import two_to_one
|
|
||||||
from methods.two_to_one_methods import methods
|
|
||||||
|
|
||||||
with gr.Blocks() as app:
|
|
||||||
gr.Markdown("Get one image from two.")
|
|
||||||
with gr.Row():
|
|
||||||
with gr.Column():
|
|
||||||
img1 = gr.Image()
|
|
||||||
img2 = gr.Image()
|
|
||||||
method = gr.Dropdown(choices=methods, value=methods[0], label="Method")
|
|
||||||
submit = gr.Button("Submit")
|
|
||||||
|
|
||||||
with gr.Column():
|
|
||||||
output = gr.Gallery()
|
|
||||||
|
|
||||||
submit.click(two_to_one, inputs=[img1, img2, method], outputs=[output])
|
|
|
@ -1,7 +1 @@
|
||||||
tabs = [
|
tabs = ["Stacking", "Bulk processing", "Images to video", "Video to images"]
|
||||||
"Stacking",
|
|
||||||
"Bulk processing",
|
|
||||||
"Two images to one",
|
|
||||||
"Images to video",
|
|
||||||
"Video to images",
|
|
||||||
]
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue