image-pluser-webui/processing/stacking.py

18 lines
334 B
Python
Raw Normal View History

2023-04-18 13:16:16 +03:00
from methods.stack_methods import (
methods_funcs,
)
2023-04-15 19:36:31 +03:00
import os
2023-04-16 09:55:33 +03:00
from processing.utils import generate_name
2023-04-15 19:36:31 +03:00
def stacking(dir, method):
files = os.listdir(dir)
files = list(map(lambda x: os.path.join(dir, x), files))
2023-04-18 13:16:16 +03:00
img = methods_funcs[method](files)
2023-04-15 19:36:31 +03:00
name = generate_name()
img.save(name)
return [name]