p1atdev commited on
Commit
d02110f
1 Parent(s): 413b5ca

feat: no grad

Browse files
Files changed (3) hide show
  1. app.py +2 -0
  2. examples/4.jpg +0 -0
  3. examples/6.jpg +0 -0
app.py CHANGED
@@ -16,6 +16,7 @@ def flush():
16
  torch.cuda.empty_cache()
17
 
18
 
 
19
  def extract(image):
20
  extractor = MangaLineExtractor("./models/erika.pth", "cpu")
21
  result = extractor.predict(image)
@@ -24,6 +25,7 @@ def extract(image):
24
  return result
25
 
26
 
 
27
  def convert_to_sketch(image):
28
  to_sketch = Anime2Sketch("./models/netG.pth", "cpu")
29
  result = to_sketch.predict(image)
 
16
  torch.cuda.empty_cache()
17
 
18
 
19
+ @torch.no_grad()
20
  def extract(image):
21
  extractor = MangaLineExtractor("./models/erika.pth", "cpu")
22
  result = extractor.predict(image)
 
25
  return result
26
 
27
 
28
+ @torch.no_grad()
29
  def convert_to_sketch(image):
30
  to_sketch = Anime2Sketch("./models/netG.pth", "cpu")
31
  result = to_sketch.predict(image)
examples/4.jpg CHANGED
examples/6.jpg CHANGED