File size: 767 Bytes
bd36795
fb37ffb
 
 
1446d6e
5f6a9dc
94fb728
5f6a9dc
8a68e19
fb37ffb
ed8c121
 
fb37ffb
 
94fb728
8a68e19
 
 
 
 
 
 
94fb728
 
 
 
 
fb37ffb
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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()