Spaces:
Build error
Build error
File size: 483 Bytes
6c51bc9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# stylization.py
import cv2
import threading
import numpy as np
class Stylizer:
def __init__(self):
self.result = None
def apply_style_threaded(self, image):
thread = threading.Thread(target=self._stylize, args=(image,))
thread.start()
thread.join()
return self.result
def _stylize(self, image):
# Example stylization: stylization filter using OpenCV
self.result = cv2.stylization(image, sigma_s=60, sigma_r=0.6) |