Spaces:
Running
Running
For Version 2
Browse files- .gitattributes +1 -0
- app.py +11 -0
.gitattributes
CHANGED
|
@@ -30,3 +30,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 30 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
| 31 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 32 |
methods/white_box_cartoonizer/saved_models/model-33999.data-00000-of-00001 filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 30 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
| 31 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 32 |
methods/white_box_cartoonizer/saved_models/model-33999.data-00000-of-00001 filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
examples/pixelArt/white_box_cartoonizer/saved_models/model-33999.data-00000-of-00001 filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
|
@@ -26,6 +26,7 @@ def GIF(fname,pixel_size):
|
|
| 26 |
frame = Image.fromarray(frame)
|
| 27 |
frame = cv2.cvtColor(np.asarray(face2paint(model, frame)), cv2.COLOR_BGR2RGB)
|
| 28 |
frames = []
|
|
|
|
| 29 |
for frame in result: #Third Step: Combining the frames into a GIF
|
| 30 |
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
| 31 |
frame = Image.fromarray(frame)
|
|
@@ -33,6 +34,16 @@ def GIF(fname,pixel_size):
|
|
| 33 |
frames[0].save('cache.gif', append_images=frames, save_all=True, loop=1)
|
| 34 |
cache = Image.open('cache.gif')
|
| 35 |
return cache
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
def initilize(image,pixel_size,checkbox1):
|
| 38 |
if image.name.endswith('.gif'):
|
|
|
|
| 26 |
frame = Image.fromarray(frame)
|
| 27 |
frame = cv2.cvtColor(np.asarray(face2paint(model, frame)), cv2.COLOR_BGR2RGB)
|
| 28 |
frames = []
|
| 29 |
+
<<<<<<< HEAD
|
| 30 |
for frame in result: #Third Step: Combining the frames into a GIF
|
| 31 |
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
| 32 |
frame = Image.fromarray(frame)
|
|
|
|
| 34 |
frames[0].save('cache.gif', append_images=frames, save_all=True, loop=1)
|
| 35 |
cache = Image.open('cache.gif')
|
| 36 |
return cache
|
| 37 |
+
=======
|
| 38 |
+
for frame in result:
|
| 39 |
+
|
| 40 |
+
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
| 41 |
+
frame = Image.fromarray(frame)
|
| 42 |
+
frames.append(frame)
|
| 43 |
+
print(type(frames), len(frames), type(frames[0]), frames[0].size)
|
| 44 |
+
frames[0].save('cache.gif', append_images=frames, save_all=True, loop=1)
|
| 45 |
+
return Image.open('cache.gif')
|
| 46 |
+
>>>>>>> a2e31df8118400de0782a9feb55255620b93cd83
|
| 47 |
|
| 48 |
def initilize(image,pixel_size,checkbox1):
|
| 49 |
if image.name.endswith('.gif'):
|