Alican Akca commited on
Commit
bd72a39
2 Parent(s): e853021 c7cd2b2

GIF and Video Processing

Browse files
Files changed (2) hide show
  1. app.py +12 -5
  2. requirements.txt +1 -1
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import cv2
2
  import torch
3
  import warnings
@@ -38,16 +39,22 @@ def initilize(media,pixel_size,checkbox1):
38
  background_image = media)
39
  else:
40
  result = pixL().toThePixL([media], pixel_size)
41
- result.save('cache.png')
42
- return [Image.fromarray(result), 'cache.png']
 
43
 
44
- inputs = [,
45
  gr.Slider(4, 100, value=12, step = 2, label="Pixel Size"),
46
  gr.Checkbox(label="Object-Oriented Inference", value=False)]
47
  outputs = [gr.Video(label="Pixed Media"),
 
48
  gr.File(label="Download")]
 
49
  title = "Pixera: Create your own Pixel Art"
50
- description = """Mobile applications will have released soon. ^^ """
 
51
  gr.Interface(fn = initilize,
52
  inputs = inputs,
53
- outputs = outputs).launch()
 
 
 
1
+ import os
2
  import cv2
3
  import torch
4
  import warnings
 
39
  background_image = media)
40
  else:
41
  result = pixL().toThePixL([media], pixel_size)
42
+ result = Image.fromarray(result)
43
+ result.save('cache.png')
44
+ return [None, result, 'cache.png']
45
 
46
+ inputs = [gr.File(label="Media"),
47
  gr.Slider(4, 100, value=12, step = 2, label="Pixel Size"),
48
  gr.Checkbox(label="Object-Oriented Inference", value=False)]
49
  outputs = [gr.Video(label="Pixed Media"),
50
+ gr.Image(label="Pixed Media"),
51
  gr.File(label="Download")]
52
+
53
  title = "Pixera: Create your own Pixel Art"
54
+ description = """Mobile applications will have released soon ^^ """
55
+
56
  gr.Interface(fn = initilize,
57
  inputs = inputs,
58
+ outputs = outputs,
59
+ title=title,
60
+ description=description).launch()
requirements.txt CHANGED
@@ -4,4 +4,4 @@ gradio
4
  Pillow
5
  imageio
6
  paddlehub
7
- opencv_python
 
4
  Pillow
5
  imageio
6
  paddlehub
7
+ opencv_pythons