Chhagan005 commited on
Commit
60e62f2
Β·
verified Β·
1 Parent(s): f181d3e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -20
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
- | Element | Status | Location |
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