import typing from pathlib import Path import gradio as gr import PIL from PIL import Image from utils import * pace_model_weights_path = (Path.cwd() / "models" / "pace_model_weights.h5").resolve() resnet50_tf_model_weights_path = (Path.cwd() / "models" / "resnet50_weights_tf_dim_ordering_tf_kernels_notop.h5") height, width, channels = (224, 224, 3) def main(): model = AudioPalette( pace_model_weights_path, resnet50_tf_model_weights_path, height, width, channels ) tab_1 = single_image_interface(model) tab_2 = multi_image_interface(model) demo = gr.TabbedInterface([tab_1, tab_2], ["Single Image", "Slide Show"], "Audio Palette") demo.queue().launch() if __name__ == "__main__": main()