15 lines
402 B
Python
15 lines
402 B
Python
def ocr_process(filename, ocr_model, coord, text, start_time, end_time):
|
|
json_data = {
|
|
"filename": filename,
|
|
"model": {"ocr_model": ocr_model},
|
|
"time": {
|
|
"duration_sec": f"{end_time - start_time:.2f}",
|
|
"started_at": start_time,
|
|
"ended_at": end_time,
|
|
},
|
|
"fields": coord,
|
|
"parsed": text,
|
|
}
|
|
|
|
return json_data
|