openfree commited on
Commit
38facb1
ยท
verified ยท
1 Parent(s): b9f6a1d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -65
app.py CHANGED
@@ -580,54 +580,7 @@ examples = [
580
  "files": ["assets/additional-examples/beam2.png"],
581
  }
582
  ],
583
- [
584
- {
585
- "text": "Compare these two X-RAY scans. Which one contains more security threats? Provide detailed analysis of prohibited items in each.",
586
- "files": ["assets/additional-examples/beam1.png", "assets/additional-examples/beam2.png"],
587
- }
588
- ],
589
- [
590
- {
591
- "text": "Is this bag safe for air travel? Check for: guns, knives, bombs, batteries, scissors, springs, and containers over 100ml.",
592
- "files": ["assets/additional-examples/beam1.png"],
593
- }
594
- ],
595
- [
596
- {
597
- "text": "Security checkpoint analysis: Identify any EOD (Explosive Ordnance Disposal) related items or components that could be assembled into weapons.",
598
- "files": ["assets/additional-examples/beam2.png"],
599
- }
600
- ],
601
- [
602
- {
603
- "text": "Quick scan for immediate threats: Focus on firearms, bladed weapons, and explosive materials only.",
604
- "files": ["assets/additional-examples/beam1.png"],
605
- }
606
- ],
607
- [
608
- {
609
- "text": "Detailed inspection required: Check for concealed weapons, electronic devices with large batteries, and any suspicious dense materials.",
610
- "files": ["assets/additional-examples/beam2.png"],
611
- }
612
- ],
613
- [
614
- {
615
- "text": "Training mode: Identify and explain why each detected item is considered a security threat according to TSA/aviation security standards.",
616
- "files": ["assets/additional-examples/beam1.png"],
617
- }
618
- ],
619
- [
620
- {
621
- "text": "Border security check: Scan for contraband, weapons, and any items that violate international travel regulations.",
622
- "files": ["assets/additional-examples/beam2.png"],
623
- }
624
- ],
625
- [
626
- {
627
- "text": "Emergency protocol: Priority scan for immediate threats - explosives, firearms, and large bladed weapons only. Report findings urgently.",
628
- "files": ["assets/additional-examples/beam1.png"],
629
- }
630
- ],
631
  ]
632
 
633
  ##############################################################################
@@ -704,23 +657,30 @@ with gr.Blocks(css=css, title="Gemma-3-R1984-4B-BEAM - X-RAY Security Scanner")
704
  # X-RAY security scanning system prompt
705
  system_prompt_box = gr.Textbox(
706
  lines=3,
707
- value="""You are an advanced X-RAY security scanning AI specialized in threat detection and aviation security. Your primary mission is to identify ALL potential security threats in X-RAY images with extreme precision.
708
-
709
- DETECTION PRIORITIES:
710
- 1. WEAPONS: Firearms (guns, pistols, rifles), knives, blades, sharp objects, martial arts weapons
711
- 2. EXPLOSIVES: Bombs, detonators, explosive materials, suspicious electronics, wires with batteries
712
- 3. PROHIBITED ITEMS: Scissors, large batteries, springs (potential weapon components), tools
713
- 4. LIQUIDS: Any container over 100ml (potential chemical threats)
714
- 5. EOD COMPONENTS: Any items that could be assembled into explosive devices
715
-
716
- ANALYSIS PROTOCOL:
717
- - Scan systematically from top-left to bottom-right
718
- - Report location of threats using grid references (e.g., "upper-left quadrant")
719
- - Classify threat severity: HIGH (immediate danger), MEDIUM (prohibited), LOW (requires inspection)
720
- - Use professional security terminology
721
- - Provide recommended actions for each threat
722
-
723
- CRITICAL: Never miss a potential threat. When in doubt, flag for manual inspection.""",
 
 
 
 
 
 
 
724
  visible=False # hidden from view
725
  )
726
 
 
580
  "files": ["assets/additional-examples/beam2.png"],
581
  }
582
  ],
583
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
584
  ]
585
 
586
  ##############################################################################
 
657
  # X-RAY security scanning system prompt
658
  system_prompt_box = gr.Textbox(
659
  lines=3,
660
+ value="""๋ฐ˜๋“œ์‹œ ํ•œ๊ธ€๋กœ ๋‹ต๋ณ€ํ•˜๋ผ. ๋‹น์‹ ์€ ์œ„ํ˜‘ ํƒ์ง€์™€ ํ•ญ๊ณต ๋ณด์•ˆ์— ํŠนํ™”๋œ ์ฒจ๋‹จ X-RAY ๋ณด์•ˆ ์Šค์บ๋‹ AI์ž…๋‹ˆ๋‹ค. ๋‹น์‹ ์˜ ์ฃผ ์ž„๋ฌด๋Š” X-RAY ์ด๋ฏธ์ง€์—์„œ ๋ชจ๋“  ์ž ์žฌ์  ๋ณด์•ˆ ์œ„ํ˜‘์„ ์ตœ์ƒ์˜ ์ •ํ™•๋„๋กœ ์‹๋ณ„ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.
661
+
662
+ ํƒ์ง€ ์šฐ์„ ์ˆœ์œ„:
663
+ 1. **๋ฌด๊ธฐ**: ํ™”๊ธฐ(๊ถŒ์ด, ์†Œ์ด ๋“ฑ), ์นผยท๋‚ ๋ถ™์ดยท์˜ˆ๋ฆฌํ•œ ๋ฌผ์ฒด, ํ˜ธ์‹ ์šฉยท๊ฒฉํˆฌ ๋ฌด๊ธฐ
664
+ 2. **ํญ๋ฐœ๋ฌผ**: ํญํƒ„, ๊ธฐํญ์žฅ์น˜, ํญ๋ฐœ์„ฑ ๋ฌผ์งˆ, ์˜์‹ฌ์Šค๋Ÿฌ์šด ์ „์ž ์žฅ์น˜, ๋ฐฐํ„ฐ๋ฆฌ๊ฐ€ ์—ฐ๊ฒฐ๋œ ์ „์„ 
665
+ 3. **๋ฐ˜์ž… ๊ธˆ์ง€ ๋ฌผํ’ˆ**: ๊ฐ€์œ„, ๋Œ€์šฉ๋Ÿ‰ ๋ฐฐํ„ฐ๋ฆฌ, ์Šคํ”„๋ง(๋ฌด๊ธฐ ๋ถ€ํ’ˆ ๊ฐ€๋Šฅ), ๊ณต๊ตฌ๋ฅ˜
666
+ 4. **์•ก์ฒด**: 100 ml ์ด์ƒ ์šฉ๊ธฐ์— ๋‹ด๊ธด ๋ชจ๋“  ์•ก์ฒด(ํ™”ํ•™ ์œ„ํ˜‘ ๊ฐ€๋Šฅ)
667
+ 5. **EOD ๊ตฌ์„ฑํ’ˆ**: ํญ๋ฐœ๋ฌผ๋กœ ์กฐ๋ฆฝ๋  ์ˆ˜ ์žˆ๋Š” ๋ชจ๋“  ๋ถ€ํ’ˆ
668
+
669
+ ๋ถ„์„ ํ”„๋กœํ† ์ฝœ:
670
+ - ์ขŒ์ƒ๋‹จ์—์„œ ์šฐํ•˜๋‹จ์œผ๋กœ ์ฒด๊ณ„์ ์œผ๋กœ ์Šค์บ”
671
+ - ์œ„ํ˜‘ ์œ„์น˜๋ฅผ ๊ฒฉ์ž ๊ธฐ์ค€์œผ๋กœ ๋ณด๊ณ (์˜ˆ: โ€œ์ขŒ์ƒ๋‹จ ์‚ฌ๋ถ„๋ฉดโ€)
672
+ - ์œ„ํ˜‘ ์‹ฌ๊ฐ๋„ ๋ถ„๋ฅ˜
673
+ - **HIGH** : ์ฆ‰๊ฐ์  ์œ„ํ—˜
674
+ - **MEDIUM** : ๋ฐ˜์ž… ๊ธˆ์ง€
675
+ - **LOW** : ์ถ”๊ฐ€ ๊ฒ€์‚ฌ ํ•„์š”
676
+ - ์ „๋ฌธ ๋ณด์•ˆ ์šฉ์–ด ์‚ฌ์šฉ
677
+ - ๊ฐ ์œ„ํ˜‘ ํ•ญ๋ชฉ๋ณ„ ๊ถŒ์žฅ ์กฐ์น˜ ์ œ์‹œ
678
+
679
+ โš ๏ธ ์ค‘๋Œ€ํ•œ ์‚ฌํ•ญ: ์ž ์žฌ์  ์œ„ํ˜‘์„ ์ ˆ๋Œ€ ๋†“์น˜์ง€ ๋งˆ์‹ญ์‹œ์˜ค. ์˜์‹ฌ์Šค๋Ÿฌ์šธ ๊ฒฝ์šฐ ๋ฐ˜๋“œ์‹œ ์ˆ˜๋™ ๊ฒ€์‚ฌ๋ฅผ ์š”์ฒญํ•˜์‹ญ์‹œ์˜ค.
680
+ """
681
+
682
+
683
+
684
  visible=False # hidden from view
685
  )
686