mirror of
https://github.com/artegoser/image-pluser-webui.git
synced 2024-11-24 04:36:20 +03:00
perf: The real mean between images and the acceleration of denoise processing
This commit is contained in:
parent
fbc9112fba
commit
26702d57f1
1 changed files with 3 additions and 13 deletions
|
@ -1,21 +1,11 @@
|
||||||
from PIL import Image, ImageChops
|
from PIL import Image, ImageChops
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
def denoise(files):
|
def denoise(files):
|
||||||
bias = 1
|
images = [np.asarray(Image.open(file)) for file in tqdm(files)]
|
||||||
image = Image.open(files[0])
|
return Image.fromarray(np.uint8(np.mean(images, axis=0)))
|
||||||
for file in tqdm(files):
|
|
||||||
alpha = 1 / bias
|
|
||||||
|
|
||||||
im2 = Image.open(file)
|
|
||||||
im3 = Image.blend(image, im2, alpha)
|
|
||||||
|
|
||||||
image = im3
|
|
||||||
|
|
||||||
bias += 1
|
|
||||||
|
|
||||||
return image
|
|
||||||
|
|
||||||
|
|
||||||
def startracks(files):
|
def startracks(files):
|
||||||
|
|
Loading…
Add table
Reference in a new issue