save hair demo
This commit is contained in:
@@ -7,7 +7,8 @@ RESIZE_TO = (256, 256)
|
||||
LARGE_IMAGE_SIZE = (2048, 2048)
|
||||
IMAGE_COUNT = 64
|
||||
|
||||
ROOT_DIR = '../example/src/main/assets/pic'
|
||||
#ROOT_DIR = '../example/src/main/assets/pic'
|
||||
ROOT_DIR = 'D:/face_sdk/example/src/main/assets/pic'
|
||||
|
||||
def load_json(file_path):
|
||||
with open(file_path, 'r') as file:
|
||||
@@ -54,7 +55,8 @@ def remove_white_border(image):
|
||||
def resize_image(image_path):
|
||||
image = Image.open(image_path).convert('RGBA')
|
||||
image = remove_white_border(image)
|
||||
return image.resize(RESIZE_TO)
|
||||
image = image.resize(RESIZE_TO)
|
||||
return image
|
||||
|
||||
def main(json_file_path):
|
||||
# 确保使用完整路径
|
||||
@@ -92,4 +94,4 @@ def main(json_file_path):
|
||||
json.dump(new_data, outfile, indent=4)
|
||||
|
||||
# 使用示例
|
||||
main('motion_data.json')
|
||||
main('motion_data_ex2.json')
|
||||
Reference in New Issue
Block a user