Skip to content

Commit 3f8f0d2

Browse files
committed
making repo pip compatiable
1 parent 6ba73b0 commit 3f8f0d2

22 files changed

+13
-37
lines changed

demo/compare_frameworks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# Code Developed by:
2121
# Ahmed A. A. Osman
2222

23-
from ch.star import STAR
23+
from star.ch.star import STAR
2424
import numpy as np
2525
batch_size = 1
2626

@@ -33,7 +33,7 @@
3333
model.pose[:] = np_pose[0]
3434
model.betas[:] = np_betas[0]
3535

36-
from tf.star import STAR
36+
from star.tf.star import STAR
3737
import tensorflow as tf
3838
import numpy as np
3939

@@ -45,7 +45,7 @@
4545
tf_star = star(pose,betas,trans)
4646
print(np.sqrt(np.sum((tf_star.numpy()-model.r)**2.0)))
4747

48-
from pytorch.star import STAR
48+
from star.pytorch.star import STAR
4949
star = STAR(gender='female',num_betas=10)
5050
import torch
5151
import numpy as np

demo/load_chumpy.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,18 @@
1919
# Code Developed by:
2020
# Ahmed A. A. Osman
2121

22-
from STAR.ch.star import STAR
22+
from star.ch.star import STAR
2323
import numpy as np
2424

2525
model = STAR(gender='female',num_betas=10)
2626
## Assign random pose and shape parameters
2727
model.pose[:] = np.random.rand(model.pose.size) * .2
2828
model.betas[:] = np.random.rand(model.betas.size) * .03
2929

30-
## Write to an .obj file
31-
outmesh_path = './hello_smpl.obj'
32-
with open( outmesh_path, 'w') as fp:
33-
for v in model.r:
34-
fp.write( 'v %f %f %f\n' % ( v[0], v[1], v[2]) )
35-
36-
for f in model.f+1: # Faces are 1-based, not 0-based in obj files
37-
fp.write( 'f %d %d %d\n' % (f[0], f[1], f[2]) )
38-
39-
## Print message
40-
print ('..Output mesh saved to: {}'.format(outmesh_path))
41-
4230
for j in range(0,10):
4331
model.betas[:] = 0.0 #Each loop all PC components are set to 0.
4432
for i in np.linspace(-3,3,10): #Varying the jth component +/- 3 standard deviations
4533
model.betas[j] = i
46-
print(model.r) #vertices=model.r and faces=model.f
47-
time.sleep(0.1)
34+
35+
4836

demo/load_tf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Code Developed by:
2020
# Ahmed A. A. Osman
2121

22-
from tf.star import STAR
22+
from star.tf.star import STAR
2323
import tensorflow as tf
2424
import numpy as np
2525
batch_size = 10
@@ -28,4 +28,4 @@
2828
trans = tf.constant(np.zeros((1,3)),dtype=tf.float32)
2929
pose = tf.constant(np.zeros((1,72)),dtype=tf.float32)
3030
betas = tf.constant(np.zeros((1,10)),dtype=tf.float32)
31-
print(star(pose,betas,trans))
31+
print(star(pose,betas,trans))

demo/load_torch.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#
1919
# Code Developed by:
2020
# Ahmed A. A. Osman
21-
from STAR.pytorch.star import STAR
21+
from star.pytorch.star import STAR
2222
import numpy as np
2323
from numpy import newaxis
2424
import pickle
@@ -43,15 +43,3 @@
4343
shaped = model.v_shaped[-1, :, :]
4444

4545

46-
## Write to an .obj file
47-
outmesh_path = './hello_star_pytorch.obj'
48-
with open( outmesh_path, 'w') as fp:
49-
for v in shaped:
50-
fp.write( 'v %f %f %f\n' % ( v[0], v[1], v[2]) )
51-
52-
for f in model.f+1: # Faces are 1-based, not 0-based in obj files
53-
fp.write( 'f %d %d %d\n' % (f[0], f[1], f[2]) )
54-
55-
## Print message
56-
print ('..Output mesh saved to: {}'.format(outmesh_path))
57-

demo/profile_tf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Code Developed by:
2020
# Ahmed A. A. Osman
2121

22-
from tf.star import STAR
22+
from star.tf.star import STAR
2323
import tensorflow as tf
2424
import time
2525
import numpy as np
@@ -35,4 +35,4 @@
3535
xstart = time.time()
3636
verts = star(pose,betas,trans)
3737
list_time.append(time.time()-xstart)
38-
print('Batch Size %d, Duration %f'%(batch_size,np.mean(list_time[10:])))
38+
print('Batch Size %d, Duration %f'%(batch_size,np.mean(list_time[10:])))

demo/profile_torch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# Ahmed A. A. Osman
2121

2222

23-
from pytorch.star import STAR
23+
from star.pytorch.star import STAR
2424
import tensorflow as tf
2525
import torch
2626
import numpy as np

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
REQUIREMENTS = ["numpy", "chumpy", "opencv-python"]
2727

2828
setuptools.setup(
29-
name='STAR',
29+
name='star',
3030
version='0.0.1',
3131
author="Ahmed A. A. Osman",
3232
author_email="ahmed.osman@tuebingen.mpg.de",
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)