jihyeonj commited on
Commit
1a49332
·
verified ·
1 Parent(s): 2157b6f

updated applciation

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. app.py +13 -10
  2. planes_processed/ancient_egyptian_architecture_02_planes.pickle +3 -0
  3. planes_processed/ancient_egyptian_temple_planes.pickle +3 -0
  4. planes_processed/birthday_cake_planes.pickle +3 -0
  5. planes_processed/castle_wall_battlement_round_02_planes.pickle +3 -0
  6. planes_processed/castle_walls_planes.pickle +3 -0
  7. planes_processed/ceiling_fan_lamp_03_planes.pickle +3 -0
  8. planes_processed/chateauesque_style_house_planes.pickle +3 -0
  9. planes_processed/chemical_storage_tank_04_planes.pickle +3 -0
  10. planes_processed/classic_facade_05_planes.pickle +3 -0
  11. planes_processed/common_chandelier_lamp_planes.pickle +3 -0
  12. planes_processed/cooked_sushi_planes.pickle +3 -0
  13. planes_processed/corner_vintage_shop_facade_planes.pickle +3 -0
  14. planes_processed/drums_set_planes.pickle +3 -0
  15. planes_processed/electricity_pylon_01_planes.pickle +3 -0
  16. planes_processed/elevated_pill_tanks_planes.pickle +3 -0
  17. planes_processed/engine_v2_01_planes.pickle +3 -0
  18. planes_processed/floral_ornament_26_planes.pickle +3 -0
  19. planes_processed/gazebo_01_planes.pickle +3 -0
  20. planes_processed/gym_bleachers_planes.pickle +3 -0
  21. planes_processed/halloween_mansion_icon_planes.pickle +3 -0
  22. planes_processed/industrial_mill_planes.pickle +3 -0
  23. planes_processed/industrial_piping_section_04_planes.pickle +3 -0
  24. planes_processed/industrial_power_unit_planes.pickle +3 -0
  25. planes_processed/industrial_rotor_box_02_planes.pickle +3 -0
  26. planes_processed/industrial_tower_06_planes.pickle +3 -0
  27. planes_processed/inflated_alphabet_shape_planes.pickle +3 -0
  28. planes_processed/japanese_floating_torii_gate_planes.pickle +3 -0
  29. planes_processed/japanese_shinto_temple_planes.pickle +3 -0
  30. planes_processed/japanese_temple_planes.pickle +3 -0
  31. planes_processed/men_stone_bust_01_planes.pickle +3 -0
  32. planes_processed/modern_building_icon_06_planes.pickle +3 -0
  33. planes_processed/pendant_light_wagon_wheel_planes.pickle +3 -0
  34. planes_processed/plant_cactus_02_set_planes.pickle +3 -0
  35. planes_processed/quadruple_traffic_lights_hanging_01_planes.pickle +3 -0
  36. planes_processed/radial_engine_planes.pickle +3 -0
  37. planes_processed/red_fire_hydrant_01_planes.pickle +3 -0
  38. planes_processed/romanesque_revival_house_planes.pickle +3 -0
  39. planes_processed/shurikens_set_planes.pickle +3 -0
  40. planes_processed/simple_traffic_light_pylone_02_planes.pickle +3 -0
  41. planes_processed/sphere_tank_planes.pickle +3 -0
  42. planes_processed/stylized_bell_tower_planes.pickle +3 -0
  43. planes_processed/stylized_dragonfly_planes.pickle +3 -0
  44. planes_processed/stylized_standing_cymbal_planes.pickle +3 -0
  45. planes_processed/telecom_pillar_planes.pickle +3 -0
  46. planes_processed/traditional_japanese_house_planes.pickle +3 -0
  47. planes_processed/traditional_japanese_temple_planes.pickle +3 -0
  48. planes_processed/triangle_tubular_lattice_beam_corner_planes.pickle +3 -0
  49. planes_processed/turbojet_engine_01_planes.pickle +3 -0
  50. planes_processed/vintage_candle_set_planes.pickle +3 -0
app.py CHANGED
@@ -2,6 +2,7 @@ import os
2
  import pickle
3
  import numpy as np
4
  import jax
 
5
 
6
  import torch
7
  from torch_geometric.nn import knn
@@ -167,7 +168,7 @@ def compute_centroids(data, labels):
167
  for label in unique_labels:
168
  mask = labels == label
169
  points = data[mask]
170
- centroid = np.mean(points, axis=0)
171
  centroids.append(centroid)
172
  return np.stack(centroids)
173
 
@@ -217,25 +218,27 @@ def create_scene(mesh_path, dicts, plane_idx):
217
  newplane = dicts[plane_idx]['plane']
218
  newplane.visual.vertex_colors = np.tile([100, 100, 100, 100], (4, 1))
219
  scene = trimesh.Scene([mesh, newplane])
220
- temp_file = f"/tmp/scene_{plane_idx}.obj"
221
  scene.export(temp_file)
222
  return temp_file
223
 
224
- def load_mesh(mesh_file_name, mode_file_name):
225
- dicts = proc_all(mesh_file_name, mode_file_name) # Assuming proc_all is defined and returns a list of dictionaries
 
 
226
  allmesh = []
227
- for i in range(min(5, len(dicts))): # Limiting to maximum 5 outputs
228
- temp_file = create_scene(mesh_file_name, dicts, i)
229
  allmesh.append(temp_file)
230
- return allmesh + [None] * (5 - len(allmesh)) # Fill the rest with None if less than 5
231
 
232
- examples = [["mesh_rescaled/" + mesh, "out_3d/" + mesh.split('.')[0][:-7] + "_50000_0.1_modes.pickle"] for mesh in os.listdir("mesh_rescaled/")]
233
 
234
- outputs = [gr.Model3D(label=f"3D Model {i+1}") for i in range(5)]
235
 
236
  demo = gr.Interface(
237
  fn=load_mesh,
238
- inputs=[gr.File(label="Upload Mesh"), gr.File(label="Upload Mode File")],
239
  outputs=outputs,
240
  examples=examples,
241
  cache_examples=False # Set to False to ensure it doesn't cache examples, requires actual file uploads
 
2
  import pickle
3
  import numpy as np
4
  import jax
5
+ import jax.numpy as jnp
6
 
7
  import torch
8
  from torch_geometric.nn import knn
 
168
  for label in unique_labels:
169
  mask = labels == label
170
  points = data[mask]
171
+ centroid = jnp.mean(points, axis=0)
172
  centroids.append(centroid)
173
  return np.stack(centroids)
174
 
 
218
  newplane = dicts[plane_idx]['plane']
219
  newplane.visual.vertex_colors = np.tile([100, 100, 100, 100], (4, 1))
220
  scene = trimesh.Scene([mesh, newplane])
221
+ temp_file = f"/tmp/{mesh_path.split['/'][-1].split('.')[0]}_{plane_idx}.obj"
222
  scene.export(temp_file)
223
  return temp_file
224
 
225
+ def load_mesh(mesh_file_name):
226
+ with open(mesh_file_name, 'rb') as f:
227
+ dicts = pickle.load(f)
228
+ #dicts = proc_all(mesh_file_name) # Assuming proc_all is defined and returns a list of dictionaries
229
  allmesh = []
230
+ for i in range(min(10, len(dicts))): # Limiting to maximum 5 outputs
231
+ temp_file = create_scene(mesh_file_name, dicts, len(dicts)-i)
232
  allmesh.append(temp_file)
233
+ return allmesh + [None] * (10 - len(allmesh)) # Fill the rest with None if less than 5
234
 
235
+ examples = [[f"planes_processed/{mesh}"] for mesh in os.listdir("planes_processed/")]
236
 
237
+ outputs = [gr.Model3D(label=f"3D Model {i+1}", height=50) for i in range(10)]
238
 
239
  demo = gr.Interface(
240
  fn=load_mesh,
241
+ inputs=[gr.File(label="Upload processed planes here")],
242
  outputs=outputs,
243
  examples=examples,
244
  cache_examples=False # Set to False to ensure it doesn't cache examples, requires actual file uploads
planes_processed/ancient_egyptian_architecture_02_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:782f8944dc2f585b9f6487bfea6303a57b89a2dc4fdb3961b992c95b17cf57fc
3
+ size 657511
planes_processed/ancient_egyptian_temple_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b51ec6fa0e3bf0020ffffce0a316aabb90989d795be8a6afaa956a82ba37aa0
3
+ size 230957
planes_processed/birthday_cake_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:847a370ccfa91b1cf3ebffec29396331fc99056c4bddc0195e268a3c8643aa08
3
+ size 2088266
planes_processed/castle_wall_battlement_round_02_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2233a9e512ad88ac0eb5b061a7bfe67c3431a37ea030f854e136e44bcb18321
3
+ size 4839913
planes_processed/castle_walls_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8f2c33ede65a40f98e321a55282d78b79332f134af67d75e4adfd6eb387da86
3
+ size 6642193
planes_processed/ceiling_fan_lamp_03_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:189cf4dfdb5e05a35199b687bfa895653885e28b1ee098bab3bb3cf58c8da708
3
+ size 1611032
planes_processed/chateauesque_style_house_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9783f0405a011cce515cfc4b7fb27f15630555f2a47c1ea2e866d50a800e07cc
3
+ size 8951903
planes_processed/chemical_storage_tank_04_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a20c33631614aa3b6cc1720a659849f3cd4d1cda3a4d62cc0b5efcbe2769fd56
3
+ size 3249210
planes_processed/classic_facade_05_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c76087745badb07aa8babfcc09a1729fbd17210c2bc5c88dcb0ee804658703d
3
+ size 2271849
planes_processed/common_chandelier_lamp_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8594c5a0c94dc9ba6fc7781f5144861509397436318155972a4f9601dbf50e71
3
+ size 1773885
planes_processed/cooked_sushi_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac1afb3762f27f7f94a5e1bd4550df1cead6ff303832175828ccae8e9ccd371f
3
+ size 244523
planes_processed/corner_vintage_shop_facade_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a25f4e8abc7e66216215c4b2781ac02a292ed40205d9b1257c8e785768874a7
3
+ size 823624
planes_processed/drums_set_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18d64a0d28c4088c429dd89eb31785e448cccbe623996347c0e3bf18060ec7eb
3
+ size 3690825
planes_processed/electricity_pylon_01_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cdfadda1cb88cdd1560d0191f6b04c68b82ca5b6ba764118d09df240699204ef
3
+ size 3084651
planes_processed/elevated_pill_tanks_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:08e68e75c1b5fa9192ec3ab75f7c2218019c0960d77c96115cab93a9ae53eb78
3
+ size 516363
planes_processed/engine_v2_01_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:48a09692dce7cbce0c72bff2c09028c1a56cad871c349d362d768cb5e634a4cc
3
+ size 1377909
planes_processed/floral_ornament_26_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22953e858d3d3569066191d46fa971e3bae632a1e60cacbdf096e40e3c55c058
3
+ size 515765
planes_processed/gazebo_01_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b72ffffc12f28d723616ad894b778cc5edfdcc6fbc78852e862d833076dbc895
3
+ size 2002785
planes_processed/gym_bleachers_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a1da305023671cd2c327a5fd9b51ea13cefcb0a7cae25c005fb4307888d9409
3
+ size 395303
planes_processed/halloween_mansion_icon_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b1cc956b89b0f7ea02c336a1e28b7a0584fd1aa6038aca3f082779f5151be358
3
+ size 588122
planes_processed/industrial_mill_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b28862361552977269cec3b8ae13cf85d3f6cf62e99e6f7127e55a3ebc04c65
3
+ size 561383
planes_processed/industrial_piping_section_04_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:53a3cdd413a88e290bbfed927048ddc3a38096a2f7f2de6a50ef851f700bd9ea
3
+ size 1820148
planes_processed/industrial_power_unit_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:713e709b2ca27b3713d4d92e4eff43c60318205835710ad52039db8c0a4286ce
3
+ size 1062495
planes_processed/industrial_rotor_box_02_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c6b6d7e0328541e1071c21410678eabe733de5b932376e3507fe6bedff5b7dad
3
+ size 1749832
planes_processed/industrial_tower_06_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4c22834dd461ef16e14ea23fe05978878d162dc6440474acd6af3ebfdbc6e347
3
+ size 1705896
planes_processed/inflated_alphabet_shape_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21bbdf7c17eec32d3527f812d5fe9e79d1e5441e865e581ff9f3dcf9e9764296
3
+ size 4206895
planes_processed/japanese_floating_torii_gate_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64bff61ba6924e5b04eb8d9dab47b12cf6e90411e690fe391db91ed72fe53f2c
3
+ size 2613740
planes_processed/japanese_shinto_temple_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:57cd652511d2ca900459928c14b5aa2408861187f55bcb1902ab4b8dc9bd6212
3
+ size 3103522
planes_processed/japanese_temple_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:663ec2ad3c0d1a5286b3f6847c921298c7ae8b1a5aaf11b96286c823bc65f871
3
+ size 6976767
planes_processed/men_stone_bust_01_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4c78e3dc0064320f4e8331b6d08b3248bc7abe97113d884a6e3be1670490d1f5
3
+ size 486596
planes_processed/modern_building_icon_06_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:31d2b054b337abfcfb4a4e02d99d987324aaacdd3235c8892e40a4269b36b8fa
3
+ size 12007572
planes_processed/pendant_light_wagon_wheel_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:15de185a307b5d13f66e05760b704c40e527c9d555bdb0f648e72989e6973ddf
3
+ size 5358785
planes_processed/plant_cactus_02_set_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:665fcfb1219e6fe49d77a42eadeed80e53f6580fef5b17b53fea7da3e82f1546
3
+ size 322675
planes_processed/quadruple_traffic_lights_hanging_01_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bec51f26e000a4e0de38fa857c2e50e69beeb3bc5bb8f4c955c9453ec15d6dc7
3
+ size 825175
planes_processed/radial_engine_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:520dabbe9fc3680f4bd9e9dd90489af385f48ca7fb3707b74fd534e2761a6192
3
+ size 8595888
planes_processed/red_fire_hydrant_01_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9329382fe2b693e7463faecd969bbce77254a68f1e10a46323b42b0dbcbd78c
3
+ size 445591
planes_processed/romanesque_revival_house_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8bbb280bc4cdd544b96735391eeadd04cbd43de33049412daf1ea600c363a176
3
+ size 2732767
planes_processed/shurikens_set_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a0d2cf05fafecb02c355c8d72911ab2cf6272a4605a527c14f8d8e1e985bc66
3
+ size 254192
planes_processed/simple_traffic_light_pylone_02_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:45d30f883498b84b851743db45089858d2e3bcf1aecd707ae5b9cf4df1f1fd1a
3
+ size 390739
planes_processed/sphere_tank_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4836b05a2a562fcdf00d7bc72b8ab6f983a49bc98c62641f190a0e375182fa19
3
+ size 673833
planes_processed/stylized_bell_tower_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b0269abd45321f030c38e3d40d45f1f7c299e57c6bd84c5176485eb8f8d5861
3
+ size 855102
planes_processed/stylized_dragonfly_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b830a972f75575a9f25532cd3fa2f7628900bb57213decb3bebebab31bf4030a
3
+ size 1076165
planes_processed/stylized_standing_cymbal_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24d55d106090de70d7e84edb06b4aa3fa96f36087d4e27502314a45a82adfec8
3
+ size 548504
planes_processed/telecom_pillar_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c428e34934128133ef3229142fb1331946ab5b108bac89c929ba0673090bfff
3
+ size 685918
planes_processed/traditional_japanese_house_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:14e2f01f2d46e003381c5dd4634cdb6197e6d361afb66bfbe03c3eb8cfdac7b0
3
+ size 10507412
planes_processed/traditional_japanese_temple_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4f95576d6b016d3d7d0f43d2aba0addb84f4b1aad7b24dbb5e0d9d10500ce1ae
3
+ size 1840025
planes_processed/triangle_tubular_lattice_beam_corner_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f84b6db24b760d30cba9d13c1036597843c1ab2a1276b4a85631a06d3625194
3
+ size 169978
planes_processed/turbojet_engine_01_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20a57e6939eb7b653b917d067240df1b6630fa9b55d0f091fef63f51df82213a
3
+ size 674937
planes_processed/vintage_candle_set_planes.pickle ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:610b8a87c9c49dc13f63121f46b21b5bd5578a10bf2e1801dfd9246327396a89
3
+ size 514022