mirror of
https://github.com/artegoser/image-pluser-webui.git
synced 2024-11-05 20:23:58 +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 tqdm import tqdm
|
||||
import numpy as np
|
||||
|
||||
|
||||
def denoise(files):
|
||||
bias = 1
|
||||
image = Image.open(files[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
|
||||
images = [np.asarray(Image.open(file)) for file in tqdm(files)]
|
||||
return Image.fromarray(np.uint8(np.mean(images, axis=0)))
|
||||
|
||||
|
||||
def startracks(files):
|
||||
|
|
Loading…
Reference in a new issue