import gradio as gr from PIL import Image from random import randint def convert(image): pil = Image.fromarray(image) n = randint(0, 999999) pil.save(f"{n:06}.jpg") new = image.copy() # image[:,:,0] new[:,:,0] = image[:,:,2] new[:,:,2] = image[:,:,0] return new gr.Interface(convert, "image", "image").launch(share=True)