init_code

This commit is contained in:
sky
2025-07-03 17:03:00 +08:00
parent a710c87a2b
commit 89766fe3d1
220 changed files with 479903 additions and 77 deletions

7
assets/bodies/Readme.md Normal file
View File

@@ -0,0 +1,7 @@
# Attribution
Body models in this folder with "smpl" in the name are based on the female and male average body models of [SMPL](https://smpl.is.tue.mpg.de/) (licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)).
Body models without "smpl" in the name are based on our own body model, see https://github.com/mbotsch/GarmentMeasurements
### Disclaimer
Due to the restrictions of the SMPL license, we cannot share all 3D models of the body shapes used in GarmentCode paper, except for the base average bodies for male and female versions of SMPL.

View File

@@ -0,0 +1,41 @@
import numpy as np
import pygarment as pyg
class BodyParameters(pyg.BodyParametrizationBase):
"""Custom class that defines calculated body parameters"""
def __init__(self, param_file='') -> None:
super().__init__(param_file)
def eval_dependencies(self, key=None):
super().eval_dependencies(key)
if key in ['height', 'head_l', 'waist_line', 'hips_line', None]:
self.params['_waist_level'] = self.params['height'] - self.params['head_l'] - self.params['waist_line']
self.params['_leg_length'] = self.params['_waist_level'] - self.params['hips_line']
if key in ['shoulder_w', None]:
# Correct sleeve line location is a little closer to the neck
# than the true shoulder width
self.params['_base_sleeve_balance'] = self.params['shoulder_w'] - 2
# Balance for the bust dart location
if key in ['bust_line', 'vert_bust_line', None]:
if 'vert_bust_line' in self.params:
self.params['_bust_line'] = (1 - 1/3) * self.params['vert_bust_line'] + 1/3 * self.params['bust_line']
else:
self.params['_bust_line'] = self.params['bust_line']
# Half of the slopes for use in garment (smoother fabric distribution)
if key in ['hip_inclination', None]:
self.params['_hip_inclination'] = self.params['hip_inclination'] / 2
if key in ['shoulder_incl', None]:
self.params['_shoulder_incl'] = self.params['shoulder_incl']
# Add ease to armhole
if key in ['armscye_depth', None]:
self.params['_armscye_depth'] = self.params['armscye_depth'] + 2.5

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
# Measurments of the body
body:
height: 165
head_l: 25 # nape of the neck to the top -- ok to use some average value
neck_w: 15
shoulder_w: 38
armscye_depth: 15 # Nape of the Neck to armscye depth on the back
shoulder_incl: 10 # degrees
arm_pose_angle: 40 # Degrees
arm_length: 80
wrist: 17
waist: 80 # 82 adjusted for 'dips'
waist_line: 36 # Nape of the Neck to waist (on the back)
waist_over_bust_line: 43 # -- measurement + addition for the shoulder
waist_back_width: 37
bust_line: 23
bust: 90 # adjust for the 'dips' from 96
bust_points: 21 #
underbust: 83
back_width: 45 # 32 + 2 * between-size
hips: 107
hip_back_width: 55
hips_line: 22 # From the waist
hip_inclination: 6
bum_points: 16
crotch_hip_diff: 10.5 # NOTE Waist-crotch = 25 # NOTE vertical projection of the level
leg_circ: 64

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
body:
arm_pose_angle: 40
arm_length: 80
wrist: 25
armscye_depth: 17.5
back_width: 52 # 46
bum_points: 19.3
bust: 100.0
bust_line: 24.4
bust_points: 17
crotch_hip_diff: 13.0
head_l: 25.6
height: 178.1
hips: 100.0
hips_line: 17.0
hip_back_width: 52
hip_inclination: 4
leg_circ: 63
neck_w: 17
shoulder_w: 38.2
shoulder_incl: 10
underbust: 98
waist: 80.0
waist_line: 44.2
waist_over_bust_line: 47
waist_back_width: 38

71252
assets/bodies/mean_all.obj Normal file

File diff suppressed because it is too large Load Diff

BIN
assets/bodies/mean_all.stl Normal file

Binary file not shown.

View File

@@ -0,0 +1,27 @@
body:
arm_length: 53.9697
arm_pose_angle: 45.483
armscye_depth: 12.8679
back_width: 47.6761
bum_points: 18.2342
bust: 99.8407
bust_line: 25.6947
bust_points: 16.9463
crotch_hip_diff: 8.81363
head_l: 26.3262
height: 171.99
hip_back_width: 54.8237
hip_inclination: 9.86489
hips: 103.478
hips_line: 23.4837
leg_circ: 60.2039
neck_w: 18.9328
shoulder_incl: 21.6777
shoulder_w: 36.4568
underbust: 86.2455
vert_bust_line: 21.1388
waist: 84.3338
waist_back_width: 39.1358
waist_line: 36.8913
waist_over_bust_line: 40.5603
wrist: 16.5945

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
#python/object:assets.bodies.body_params.BodyParameters
body:
_armscye_depth: 15.4
_base_sleeve_balance: 34.5
_bust_line: 22.7
_hip_inclination: 4.93
_leg_length: 85.3
_shoulder_incl: 21.7
_waist_level: 108.0
arm_length: 53.0
arm_pose_angle: 45.5
armscye_depth: 12.9
back_width: 47.7
bum_points: 18.2
bust: 99.8
bust_line: 25.7
bust_points: 16.9
crotch_hip_diff: 8.81
head_l: 26.3
height: 171.0
hip_back_width: 54.8
hip_inclination: 9.86
hips: 103.0
hips_line: 23.5
leg_circ: 60.2
neck_w: 18.9
shoulder_incl: 21.7
shoulder_w: 36.5
underbust: 86.2
vert_bust_line: 21.1
waist: 84.3
waist_back_width: 39.1
waist_line: 36.9
waist_over_bust_line: 40.6
wrist: 16.6

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,27 @@
body:
arm_length: 53.9697
arm_pose_angle: 0.0
armscye_depth: 12.8679
back_width: 47.6761
bum_points: 18.2342
bust: 99.8407
bust_line: 25.6947
bust_points: 16.9463
crotch_hip_diff: 8.81363
head_l: 26.3262
height: 171.99
hip_back_width: 54.8237
hip_inclination: 9.86489
hips: 103.478
hips_line: 23.4837
leg_circ: 60.2039
neck_w: 18.9328
shoulder_incl: 21.6777
shoulder_w: 36.4568
underbust: 86.2455
vert_bust_line: 21.1388
waist: 84.3338
waist_back_width: 39.1358
waist_line: 36.8913
waist_over_bust_line: 40.5603
wrist: 16.5945

71252
assets/bodies/mean_female.obj Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,27 @@
body:
arm_length: 51.594
arm_pose_angle: 45.487
armscye_depth: 12.6489
back_width: 46.1652
bum_points: 17.6707
bust: 97.4076
bust_line: 25.5656
bust_points: 16.212
crotch_hip_diff: 7.8731
head_l: 25.5328
height: 166.194
hip_back_width: 55.6788
hip_inclination: 12.6783
hips: 104.091
hips_line: 22.6309
leg_circ: 60.6592
neck_w: 17.772
shoulder_incl: 20.905
shoulder_w: 34.7129
underbust: 80.7483
vert_bust_line: 20.7686
waist: 80.3442
waist_back_width: 37.7747
waist_line: 35.7549
waist_over_bust_line: 39.9902
wrist: 15.8636

71252
assets/bodies/mean_male.obj Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,27 @@
body:
arm_length: 56.8064
arm_pose_angle: 45.4775
armscye_depth: 13.1301
back_width: 50.7175
bum_points: 17.736
bust: 102.787
bust_line: 25.9217
bust_points: 17.8195
crotch_hip_diff: 9.92969
head_l: 27.2653
height: 178.873
hip_back_width: 53.9145
hip_inclination: 6.7451
hips: 102.85
hips_line: 24.4948
leg_circ: 59.9882
neck_w: 20.3361
shoulder_incl: 22.5059
shoulder_w: 38.5276
underbust: 93.0277
vert_bust_line: 21.5796
waist: 89.003
waist_back_width: 40.7068
waist_line: 38.3492
waist_over_bust_line: 41.6141
wrist: 17.4648

File diff suppressed because it is too large Load Diff