File size: 516 Bytes
25a41e9
 
 
 
795c1e9
 
0ff07b3
30ac2e5
25a41e9
0ff07b3
 
 
25a41e9
0ff07b3
25a41e9
82fdcdc
795c1e9
 
25a41e9
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
import os
from pathlib import Path

proj_dir1 = Path.cwd()
print(f"proj_dir1 -- {proj_dir1}")
tmp1 = str(proj_dir1 / 'media' / 'banner.png')
print(f"string1 -- {tmp1}")

proj_dir2 = Path(__file__).parent
print(f"proj_dir -- {proj_dir2}")
tmp = str(proj_dir2 / 'media' / 'banner.png')
print(f"string -- {tmp}")
print(f"Path(__file__) - {Path(__file__)}")
with gr.Blocks() as demo:
    img = gr.Image(value= tmp, type='filepath')
    img = gr.Image(value= tmp1, type='filepath')
    

demo.launch()