jingyangcarl commited on
Commit
07a1e16
·
1 Parent(s): f6a3903

update gui

Browse files
Files changed (2) hide show
  1. app.py +1 -5
  2. app_texnet.py +10 -14
app.py CHANGED
@@ -9,7 +9,7 @@ from app_texnet import create_demo as create_demo_texnet
9
  from model import Model
10
  from settings import ALLOW_CHANGING_BASE_MODEL, DEFAULT_MODEL_ID, SHOW_DUPLICATE_BUTTON
11
 
12
- DESCRIPTION = "# Material Authoring Demo v0.1. Under Construction"
13
 
14
  if not torch.cuda.is_available():
15
  DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p> Check if the 'CUDA_VISIBLE_DEVICES' are set incorrectly in settings.py"
@@ -26,12 +26,8 @@ with gr.Blocks() as demo:
26
  )
27
 
28
  with gr.Tabs():
29
- # with gr.Tab("Canny"):
30
- # create_demo_canny(model.process_canny)
31
  with gr.Tab("Texnet+Matnet"):
32
  create_demo_texnet(model.process_texnet)
33
- # with gr.Tab("Matnet"):
34
- # create_demo_texnet(model.process_texnet)
35
 
36
  with gr.Accordion(label="Base model", open=False):
37
  with gr.Row():
 
9
  from model import Model
10
  from settings import ALLOW_CHANGING_BASE_MODEL, DEFAULT_MODEL_ID, SHOW_DUPLICATE_BUTTON
11
 
12
+ DESCRIPTION = "# Material Authoring Demo v0.2"
13
 
14
  if not torch.cuda.is_available():
15
  DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p> Check if the 'CUDA_VISIBLE_DEVICES' are set incorrectly in settings.py"
 
26
  )
27
 
28
  with gr.Tabs():
 
 
29
  with gr.Tab("Texnet+Matnet"):
30
  create_demo_texnet(model.process_texnet)
 
 
31
 
32
  with gr.Accordion(label="Base model", open=False):
33
  with gr.Row():
app_texnet.py CHANGED
@@ -92,7 +92,7 @@ def create_demo(process):
92
  with gr.Blocks() as demo:
93
  with gr.Row():
94
  with gr.Column():
95
- gr.Markdown("Select from the examples")
96
  with gr.Row():
97
  name = gr.Textbox(label="Name", interactive=False, visible=False)
98
  representative = gr.Image(label="Geometry", interactive=False)
@@ -119,22 +119,18 @@ def create_demo(process):
119
  value="longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
120
  )
121
  with gr.Column():
122
- # tex_fine = gr.Gallery(label="Output Texture", show_label=True, columns=2, object_fit="scale-down")
123
- base_color = gr.Gallery(label="Base Color", show_label=True, columns=1, object_fit="scale-down")
124
- normal = gr.Gallery(label="Normal Map", show_label=True, columns=1, object_fit="scale-down")
125
- roughness = gr.Gallery(label="Roughness Map", show_label=True, columns=1, object_fit="scale-down")
126
- metallic = gr.Gallery(label="Metallic Map", show_label=True, columns=1, object_fit="scale-down")
127
- # base_color = gr.Image(label="Base Color", show_label=True, object_fit="scale-down")
128
- # normal = gr.Image(label="Normal Map", show_label=True, object_fit="scale-down")
129
- # roughness = gr.Image(label="Roughness Map", show_label=True, object_fit="scale-down")
130
- # metallic = gr.Image(label="Metallic Map", show_label=True, object_fit="scale-down")
131
 
 
132
  out_blender_path = gr.File(label="Generated Blender File", file_types=[".blend"])
133
 
134
- # radio buttons let the user toggle which texture to view
135
- # texture_choice = gr.Radio(["Input", "Coarse", "Fine"], label="Preview texture", value="Input")
136
- # mesh_path_state = gr.State("examples/bunny/mesh.obj")
137
-
138
  inputs = [
139
  name, # Name of the object
140
  representative, # Geometry mesh
 
92
  with gr.Blocks() as demo:
93
  with gr.Row():
94
  with gr.Column():
95
+ gr.Markdown("## Select preset from the example list, and modify the prompt accordingly")
96
  with gr.Row():
97
  name = gr.Textbox(label="Name", interactive=False, visible=False)
98
  representative = gr.Image(label="Geometry", interactive=False)
 
119
  value="longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
120
  )
121
  with gr.Column():
122
+ # 2x2 grid of images for the output textures
123
+ gr.Markdown("### Output BRDF")
124
+ with gr.Row():
125
+ base_color = gr.Gallery(label="Base Color", show_label=True, columns=1, object_fit="scale-down")
126
+ normal = gr.Gallery(label="Displacement Map", show_label=True, columns=1, object_fit="scale-down")
127
+ with gr.Row():
128
+ roughness = gr.Gallery(label="Roughness Map", show_label=True, columns=1, object_fit="scale-down")
129
+ metallic = gr.Gallery(label="Metallic Map", show_label=True, columns=1, object_fit="scale-down")
 
130
 
131
+ gr.Markdown("### Download Packed Blender Files for 3D Visualization")
132
  out_blender_path = gr.File(label="Generated Blender File", file_types=[".blend"])
133
 
 
 
 
 
134
  inputs = [
135
  name, # Name of the object
136
  representative, # Geometry mesh