File size: 986 Bytes
ce91ea1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from run import convert_to_3d


def process_image(image_path, output_filename='', convert_type='x'):
    output_file = ''
    if convert_type == "x":
        output_file = convert_to_3d(image_path, output_filename=output_filename)
    elif convert_type == "Human":
        output_file = convert_to_3d(image_path, output_filename=output_filename, isHuman=True)
    elif convert_type == "Full":
        output_file = convert_to_3d(image_path, output_filename=output_filename, isCloth=True)
    elif convert_type == "Upper":
        output_file = convert_to_3d(image_path, output_filename=output_filename, isCloth=True, cloth_cat="upper")
    elif convert_type == "Lower":
        output_file = convert_to_3d(image_path, output_filename=output_filename, isCloth=True, cloth_cat="lower")

    if output_file != '':
        print(f"Conversion to 3D object completed. Saved to {output_file}")
    else:
        print("Conversion failed or output file path is empty.")