<jupyter_start><jupyter_text><jupyter_code>!pip  install tensorflow==1.14.0
!pip install scipy==1.1.0
!git clone https://github.com/3Thiago/Keras-GAN.git
!bash /content/Keras-GAN/cyclegan/download_dataset.sh apple2orange
!pip install git+https://www.github.com/keras-team/keras-contrib.git
!python /content/Keras-GAN/cyclegan/cyclegan.py
#!rm -rf  /content/images/apple2orange
import os
from packaging import version
from PIL import Image

pasta = '/content/images/apple2orange'
filenames =  os.listdir(pasta)
print(filenames)


images = []
for filename in filenames:
  a = pasta+'/'+filename
  images.append(a)
  print(images)



im1 = Image.open('/content/images/apple2orange/0_0.png')

if version.parse(Image.PILLOW_VERSION) < version.parse("3.4"):
    print("Pillow in version not supporting making animated gifs")
    print("you need to upgrade library version")
    print("see release notes in")
    print("https://pillow.readthedocs.io/en/latest/releasenotes/3.4.0.html#append-images-to-gif")
else:
    im1.save("/content/images/out.gif", save_all=True, append_images=images, duration=100, loop=0)
import glob
import moviepy.editor as mpy

gif_name = '/content/images/outputName'
fps = 12
file_list = glob.glob('/content/images/apple2orange/*.png') # Get all the pngs in the current directory
list.sort(file_list, key=lambda x: int(x.split('_')[1].split('.png')[0])) # Sort the images by #, this may need to be tweaked for your use case
clip = mpy.ImageSequenceClip(file_list, fps=fps)
clip.write_gif('{}.gif'.format(gif_name), fps=fps)
!cd /content/images && zip apple2orange.zip -r /content/images/apple2orange<jupyter_output>updating: content/images/apple2orange/ (stored 0%)
  adding: content/images/apple2orange/27_0.png (deflated 1%)
  adding: content/images/apple2orange/77_0.png (deflated 1%)
  adding: content/images/apple2orange/21_0.png (deflated 1%)
  adding: content/images/apple2orange/151_0.png (deflated 1%)
  adding: content/images/apple2orange/134_0.png (deflated 1%)
  adding: content/images/apple2orange/28_0.png (deflated 1%)
  adding: content/images/apple2orange/140_0.png (deflated 1%)
  adding: content/images/apple2orange/156_0.png (deflated 1%)
  adding: content/images/apple2orange/23_0.png (deflated 1%)
  adding: content/images/apple2orange/141_0.png (deflated 1%)
  adding: content/images/apple2orange/109_0.png (deflated 1%)
  adding: content/images/apple2orange/122_0.png (deflated 1%)
  adding: content/images/apple2orange/144_0.png (deflated 1%)
  adding: content/images/apple2orange/173_0.png (deflated 1%)
  adding: content/images/apple2orange/195_0.png (deflated 1%)
  adding: content/images[...]
{'fraction_non_alphanumeric': 0.13977272727272727, 'fraction_numerical': 0.045075757575757575, 'mean_word_length': 5.071264367816092, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '654947', 'license': 'MIT', 'n_tokens_mistral': 1036, 'n_tokens_neox': 952, 'n_words': 188, 'path': 'CycleGan_Teste.ipynb', 'repo_name': '3Thiago/Keras-GAN', 'size': '2640'}