Yuliang commited on
Commit
c0b5d8f
1 Parent(s): 8a246ed

OOM solved

Browse files
.gitignore CHANGED
@@ -13,3 +13,4 @@ kaolin/
13
  neural_voxelization_layer/
14
  pytorch3d/
15
  force_push.sh
 
 
13
  neural_voxelization_layer/
14
  pytorch3d/
15
  force_push.sh
16
+ results/
app.py CHANGED
@@ -117,7 +117,7 @@ with gr.Blocks() as demo:
117
 
118
  gr.Examples(examples=examples,
119
  inputs=[inp, radio_choice],
120
- cache_examples=False,
121
  fn=generate_model,
122
  outputs=out_lst)
123
 
 
117
 
118
  gr.Examples(examples=examples,
119
  inputs=[inp, radio_choice],
120
+ cache_examples=True,
121
  fn=generate_model,
122
  outputs=out_lst)
123
 
apps/infer.py CHANGED
@@ -14,10 +14,9 @@
14
  #
15
  # Contact: ps-license@tuebingen.mpg.de
16
 
17
- import os
18
 
19
  import logging
20
- from lib.common.render import query_color
21
  from lib.common.config import cfg
22
  from lib.dataset.mesh_util import (
23
  load_checkpoint,
@@ -403,7 +402,7 @@ def generate_model(in_path, model_type):
403
  loop_cloth.set_description(pbar_desc)
404
 
405
  # update params
406
- cloth_loss.backward(retain_graph=True)
407
  optimizer_cloth.step()
408
  scheduler_cloth.step(cloth_loss)
409
 
@@ -414,13 +413,6 @@ def generate_model(in_path, model_type):
414
  process=False, maintains_order=True
415
  )
416
 
417
- # with front texture
418
- # final_colors = query_color(
419
- # mesh_pr.verts_packed().detach().squeeze(0).cpu(),
420
- # mesh_pr.faces_packed().detach().squeeze(0).cpu(),
421
- # in_tensor["image"],
422
- # device=device,
423
- # )
424
 
425
  # without front texture
426
  final_colors = (mesh_pr.verts_normals_padded().squeeze(0).detach().cpu() + 1.0) * 0.5 * 255.0
@@ -458,7 +450,7 @@ def generate_model(in_path, model_type):
458
  for element in dir():
459
  if 'path' not in element:
460
  del locals()[element]
461
-
462
  torch.cuda.empty_cache()
463
 
464
  return [smpl_path, smpl_path, smpl_npy_path, recon_path, recon_path, refine_path, refine_path, video_path, overlap_path]
 
14
  #
15
  # Contact: ps-license@tuebingen.mpg.de
16
 
17
+ import os, gc
18
 
19
  import logging
 
20
  from lib.common.config import cfg
21
  from lib.dataset.mesh_util import (
22
  load_checkpoint,
 
402
  loop_cloth.set_description(pbar_desc)
403
 
404
  # update params
405
+ cloth_loss.backward()
406
  optimizer_cloth.step()
407
  scheduler_cloth.step(cloth_loss)
408
 
 
413
  process=False, maintains_order=True
414
  )
415
 
 
 
 
 
 
 
 
416
 
417
  # without front texture
418
  final_colors = (mesh_pr.verts_normals_padded().squeeze(0).detach().cpu() + 1.0) * 0.5 * 255.0
 
450
  for element in dir():
451
  if 'path' not in element:
452
  del locals()[element]
453
+ gc.collect()
454
  torch.cuda.empty_cache()
455
 
456
  return [smpl_path, smpl_path, smpl_npy_path, recon_path, recon_path, refine_path, refine_path, video_path, overlap_path]
gradio_cached_examples/13/log.csv ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ 'flag','username','timestamp'
2
+ '','','2022-08-01 22:47:24.908073'
3
+ '','','2022-08-01 22:48:20.753663'
4
+ '','','2022-08-01 22:49:15.504871'
5
+ '','','2022-08-01 22:50:16.762017'
6
+ '','','2022-08-01 22:51:09.444531'
7
+ '','','2022-08-01 22:52:09.357219'
8
+ '','','2022-08-01 22:53:02.217347'
9
+ '','','2022-08-01 22:54:11.545178'
gradio_queue.db ADDED
Binary file (610 kB). View file
 
lib/net/FBNet.py CHANGED
@@ -81,7 +81,8 @@ def define_G(input_nc,
81
  # print(netG)
82
  if len(gpu_ids) > 0:
83
  assert (torch.cuda.is_available())
84
- netG.cuda(gpu_ids[0])
 
85
  netG.apply(weights_init)
86
  return netG
87
 
 
81
  # print(netG)
82
  if len(gpu_ids) > 0:
83
  assert (torch.cuda.is_available())
84
+ device=torch.device(f"cuda:{gpu_ids[0]}")
85
+ netG = netG.to(device)
86
  netG.apply(weights_init)
87
  return netG
88