RamAnanth1 commited on
Commit
1ca0068
1 Parent(s): 80ea7a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -5,7 +5,7 @@ import PIL.Image
5
 
6
  from gradio_client import Client
7
 
8
- shap_e_client = Client("hysts/Shap-E")
9
  triposr_client = Client("stabilityai/TripoSR")
10
 
11
 
@@ -14,13 +14,11 @@ def run(image, model_name):
14
  image.save(file_path)
15
  print(file_path)
16
  model_name = model_name.lower()
17
- if model_name=='shap-e':
18
- result = shap_e_client.predict(
19
- file_path, # filepath in 'Input image' Image component
20
- 0, # float (numeric value between 0 and 2147483647) in 'Seed' Slider component
21
- 1, # float (numeric value between 1 and 20) in 'Guidance scale' Slider component
22
- 2, # float (numeric value between 2 and 100) in 'Number of inference steps' Slider component
23
- api_name="/image-to-3d")
24
  output = result
25
 
26
  elif model_name=='triposr':
@@ -37,7 +35,7 @@ def run(image, model_name):
37
  32, # float (numeric value between 32 and 320) in 'Marching Cubes Resolution' Slider component
38
  api_name="/generate")
39
 
40
- output = result[1]
41
 
42
  return output
43
 
 
5
 
6
  from gradio_client import Client
7
 
8
+ lgm_mini_client = Client("dylanebert/LGM-mini")
9
  triposr_client = Client("stabilityai/TripoSR")
10
 
11
 
 
14
  image.save(file_path)
15
  print(file_path)
16
  model_name = model_name.lower()
17
+ if model_name=='lgm-mini':
18
+ result = lgm_mini_client.predict(
19
+ file_path, # filepath in 'image' Image component
20
+ api_name="/run"
21
+ )
 
 
22
  output = result
23
 
24
  elif model_name=='triposr':
 
35
  32, # float (numeric value between 32 and 320) in 'Marching Cubes Resolution' Slider component
36
  api_name="/generate")
37
 
38
+ output = result[0]
39
 
40
  return output
41