ldkong commited on
Commit
e5456b5
β€’
1 Parent(s): 5a70ae3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -8
app.py CHANGED
@@ -69,7 +69,6 @@ def run(domain_source, action_source, hair_source, top_source, bottom_source, do
69
  # == Source Avatar ==
70
  # body
71
  body_source = '0'
72
- body_target = '1'
73
 
74
  # hair
75
  if hair_source == "green": hair_source = '0'
@@ -95,12 +94,28 @@ def run(domain_source, action_source, hair_source, top_source, bottom_source, do
95
  gif = display_gif_pad(file_name_source, 'avatar_source.gif')
96
 
97
  # == Target Avatar ==
 
98
  body_target = '1'
99
- hair_target = np.random.choice(['1', '3', '5', '6', '9'])
100
- top_target = np.random.choice(['3', '4', '5', '6'])
101
- bottom_target = np.random.choice(['4', '5', '6'])
102
 
103
- file_name_target = './Sprite/frames/domain_2/' + action + '/'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  file_name_target = file_name_target + 'front' + '_' + str(body_target) + str(bottom_target) + str(top_target) + str(hair_target) + '_'
105
 
106
  gif_target = display_gif_pad(file_name_target, 'avatar_target.gif')
@@ -118,9 +133,9 @@ gr.Interface(
118
  gr.Radio(choices=["white", "golden", "red", "silver"], value="white"),
119
  gr.Textbox(value="Target Avatar - Alien", interactive=False),
120
  gr.Radio(choices=["slash", "spellcard", "walk"], value="walk"),
121
- gr.Radio(choices=["green", "yellow", "rose", "red", "wine"], value="green"),
122
- gr.Radio(choices=["brown", "blue", "white"], value="brown"),
123
- gr.Radio(choices=["white", "golden", "red", "silver"], value="white"),
124
  ],
125
  outputs=[
126
  gr.components.Image(type="file", label="Source Avatar (Costumed by You)"),
 
69
  # == Source Avatar ==
70
  # body
71
  body_source = '0'
 
72
 
73
  # hair
74
  if hair_source == "green": hair_source = '0'
 
94
  gif = display_gif_pad(file_name_source, 'avatar_source.gif')
95
 
96
  # == Target Avatar ==
97
+ # body
98
  body_target = '1'
 
 
 
99
 
100
+ # hair
101
+ if hair_target == "violet": hair_target = '1'
102
+ elif hair_target == "silver": hair_target = '3'
103
+ elif hair_target == "purple": hair_target = '5'
104
+ elif hair_target == "grey": hair_target = '6'
105
+ elif hair_target == "golden": hair_target = '9'
106
+
107
+ # top
108
+ if top_target == "grey": top_target = '3'
109
+ elif top_target == "khaki": top_target = '4'
110
+ elif top_target == "linen": top_target = '5'
111
+ elif top_target == "ocre": top_target = '6'
112
+
113
+ # bottom
114
+ if bottom_source == "denim": bottom_source = '4'
115
+ elif bottom_source == "olive": bottom_source = '5'
116
+ elif bottom_source == "brown": bottom_source = '6'
117
+
118
+ file_name_target = './Sprite/frames/domain_2/' + action_target + '/'
119
  file_name_target = file_name_target + 'front' + '_' + str(body_target) + str(bottom_target) + str(top_target) + str(hair_target) + '_'
120
 
121
  gif_target = display_gif_pad(file_name_target, 'avatar_target.gif')
 
133
  gr.Radio(choices=["white", "golden", "red", "silver"], value="white"),
134
  gr.Textbox(value="Target Avatar - Alien", interactive=False),
135
  gr.Radio(choices=["slash", "spellcard", "walk"], value="walk"),
136
+ gr.Radio(choices=["violet", "silver", "purple", "grey", "golden"], value="golden"),
137
+ gr.Radio(choices=["grey", "khaki", "linen", "ocre"], value="ocre"),
138
+ gr.Radio(choices=["denim", "olive", "brown"], value="white"),
139
  ],
140
  outputs=[
141
  gr.components.Image(type="file", label="Source Avatar (Costumed by You)"),