CoolFace
Apppublic

onlycaps/audio_palette

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes
app.py32 linesDownload Raw Back to root
1import typing2from pathlib import Path3 4import gradio as gr5 6import PIL7from PIL import Image8 9from utils import *10 11pace_model_weights_path = (Path.cwd() / "models" / "pace_model_weights.h5").resolve()12resnet50_tf_model_weights_path = (Path.cwd() / "models" / "resnet50_weights_tf_dim_ordering_tf_kernels_notop.h5")13height, width, channels = (224, 224, 3)14 15def main():16    model = AudioPalette(17        pace_model_weights_path,18        resnet50_tf_model_weights_path,19        height,20        width,21        channels22    )23 24    tab_1 = single_image_interface(model)25    tab_2 = multi_image_interface(model)26 27    demo = gr.TabbedInterface([tab_1, tab_2], ["Single Image", "Slide Show"], "Audio Palette")28    demo.queue().launch()29 30if __name__ == "__main__":31    main()32