Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -860,35 +860,34 @@ def run_step2_structure(model, processor, metadata: dict, device,
|
|
| 860 |
|
| 861 |
# Pre-build Python-verified sections
|
| 862 |
python_sections = f"""## πΌοΈ Visual Elements
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 863 |
|
| 864 |
-
|
| 865 |
-
|---------|--------|----------|
|
| 866 |
-
| π· Profile Photo | {metadata['photo_present']} | {metadata['photo_location']} |
|
| 867 |
-
| βοΈ Signature | {metadata['sig_present']} | {metadata['sig_location']} |
|
| 868 |
-
| π MRZ Zone | {metadata['mrz_present']} | Bottom strip |
|
| 869 |
|
| 870 |
-
|
| 871 |
-
|
| 872 |
-
## β
English Fields (Direct from Card β Not Modified)
|
| 873 |
-
{cal_note}
|
| 874 |
|
| 875 |
-
{tbl}
|
| 876 |
|
| 877 |
-
---
|
| 878 |
|
| 879 |
-
## π Original Script
|
| 880 |
|
| 881 |
-
{raw_text}
|
| 882 |
-
---
|
| 883 |
|
| 884 |
-
## π MRZ Data
|
| 885 |
|
| 886 |
-
{chr(10).join([l for l in raw_text.split(chr(10)) if re.match(r'^[A-Z0-9<]{25,50}$', re.sub(r'\s+','',l.strip()))]) or 'NOT PRESENT'}
|
| 887 |
-
{build_mrz_table(mrz_data) if mrz_data else '_No MRZ detected._'}
|
| 888 |
|
| 889 |
-
---
|
| 890 |
-
|
| 891 |
-
|
| 892 |
return streamer, thread, mrz_data, python_sections
|
| 893 |
|
| 894 |
|
|
|
|
| 860 |
|
| 861 |
# Pre-build Python-verified sections
|
| 862 |
python_sections = f"""## πΌοΈ Visual Elements
|
| 863 |
+
| Element | Status | Location |
|
| 864 |
+
|---------|--------|----------|
|
| 865 |
+
| π· Profile Photo | {metadata['photo_present']} | {metadata['photo_location']} |
|
| 866 |
+
| βοΈ Signature | {metadata['sig_present']} | {metadata['sig_location']} |
|
| 867 |
+
| π MRZ Zone | {metadata['mrz_present']} | Bottom strip |
|
| 868 |
|
| 869 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 870 |
|
| 871 |
+
## β
English Fields (Direct from Card β Not Modified)
|
| 872 |
+
{cal_note}
|
|
|
|
|
|
|
| 873 |
|
| 874 |
+
{tbl}
|
| 875 |
|
| 876 |
+
---
|
| 877 |
|
| 878 |
+
## π Original Script
|
| 879 |
|
| 880 |
+
{raw_text}
|
| 881 |
+
---
|
| 882 |
|
| 883 |
+
## π MRZ Data
|
| 884 |
|
| 885 |
+
{chr(10).join([l for l in raw_text.split(chr(10)) if re.match(r'^[A-Z0-9<]{25,50}$', re.sub(r'\s+','',l.strip()))]) or 'NOT PRESENT'}
|
| 886 |
+
{build_mrz_table(mrz_data) if mrz_data else '_No MRZ detected._'}
|
| 887 |
|
| 888 |
+
---
|
| 889 |
+
"""
|
| 890 |
+
|
| 891 |
return streamer, thread, mrz_data, python_sections
|
| 892 |
|
| 893 |
|