datnguyentien204's picture
Upload 337 files
ce91ea1 verified
raw
history blame
986 Bytes
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.")