Spaces:
Paused
Paused
alessandro trinca tornidor
commited on
Commit
·
db609a2
1
Parent(s):
937bd43
[refactor] renamed inference() argument, updated logs
Browse files- utils/app_helpers.py +4 -4
utils/app_helpers.py
CHANGED
|
@@ -205,12 +205,12 @@ def get_inference_model_by_args(args_to_parse):
|
|
| 205 |
no_seg_out, error_happened = placeholders["no_seg_out"], placeholders["error_happened"]
|
| 206 |
|
| 207 |
@session_logger.set_uuid_logging
|
| 208 |
-
def inference(input_str,
|
| 209 |
## filter out special chars
|
| 210 |
|
| 211 |
input_str = get_cleaned_input(input_str)
|
| 212 |
-
logging.info(f"input_str type: {type(input_str)}, input_image type: {type(
|
| 213 |
-
logging.info(f"input_str: {input_str}.")
|
| 214 |
|
| 215 |
## input valid check
|
| 216 |
if not re.match(r"^[A-Za-z ,.!?\'\"]+$", input_str) or len(input_str) < 1:
|
|
@@ -233,7 +233,7 @@ def get_inference_model_by_args(args_to_parse):
|
|
| 233 |
conv.append_message(conv.roles[1], "")
|
| 234 |
prompt = conv.get_prompt()
|
| 235 |
|
| 236 |
-
image_np = cv2.imread(
|
| 237 |
image_np = cv2.cvtColor(image_np, cv2.COLOR_BGR2RGB)
|
| 238 |
original_size_list = [image_np.shape[:2]]
|
| 239 |
|
|
|
|
| 205 |
no_seg_out, error_happened = placeholders["no_seg_out"], placeholders["error_happened"]
|
| 206 |
|
| 207 |
@session_logger.set_uuid_logging
|
| 208 |
+
def inference(input_str, input_image_pathname):
|
| 209 |
## filter out special chars
|
| 210 |
|
| 211 |
input_str = get_cleaned_input(input_str)
|
| 212 |
+
logging.info(f"input_str type: {type(input_str)}, input_image type: {type(input_image_pathname)}.")
|
| 213 |
+
logging.info(f"input_str: {input_str}, input_image: {type(input_image_pathname)}.")
|
| 214 |
|
| 215 |
## input valid check
|
| 216 |
if not re.match(r"^[A-Za-z ,.!?\'\"]+$", input_str) or len(input_str) < 1:
|
|
|
|
| 233 |
conv.append_message(conv.roles[1], "")
|
| 234 |
prompt = conv.get_prompt()
|
| 235 |
|
| 236 |
+
image_np = cv2.imread(input_image_pathname)
|
| 237 |
image_np = cv2.cvtColor(image_np, cv2.COLOR_BGR2RGB)
|
| 238 |
original_size_list = [image_np.shape[:2]]
|
| 239 |
|