Knowledge2Model/KG2Model/InputCode.py

22 lines
420 B
Python
Raw Normal View History

2024-01-23 22:51:25 +08:00
def input_code(input_type):
if input_type == 'ImageData':
ret = """\
import cv2
import numpy as np
# Path to the image
image_path = "D:\\Bilder\\m_ali.jpg"
# Read the image
input_img = cv2.imread(image_path)
"""
return ret
elif input_type == 'TextData':
ret="""\
text = "Replace this with your text here"
"""
return ret
else:
return ''