Update app.py
Browse files
app.py
CHANGED
@@ -4,10 +4,16 @@ import cv2
|
|
4 |
import numpy as np
|
5 |
import time
|
6 |
import random
|
7 |
-
|
8 |
from PIL import Image
|
9 |
from transparent_background import Remover
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
@spaces.GPU # 修改装饰器,去掉括号
|
12 |
def doo(video, mode):
|
13 |
if(mode == 'Fast'):
|
|
|
4 |
import numpy as np
|
5 |
import time
|
6 |
import random
|
7 |
+
import torch
|
8 |
from PIL import Image
|
9 |
from transparent_background import Remover
|
10 |
|
11 |
+
@torch.jit.script
|
12 |
+
def hard_sigmoid_jit_bwd(x: torch.Tensor, grad_output: torch.Tensor) -> torch.Tensor:
|
13 |
+
m = torch.ones_like(x) * ((x >= -3.) & (x <= 3.)) / 6.
|
14 |
+
return grad_output * m
|
15 |
+
|
16 |
+
|
17 |
@spaces.GPU # 修改装饰器,去掉括号
|
18 |
def doo(video, mode):
|
19 |
if(mode == 'Fast'):
|