MCPcopy Create free account
hub / github.com/AdbAutoPlayer/AdbAutoPlayer / main

Function main

src-tauri/src-python/scripts/test_activeness_ocr.py:853–886  ·  view source on GitHub ↗

Execute main script logic to test OCR performance on debug frames.

()

Source from the content-addressed store, hash-verified

851
852
853def main():
854 """Execute main script logic to test OCR performance on debug frames."""
855 rapid = RapidOCRBackend.pp_ocr_v5_rec()
856
857 # Try to load Qwen2-VL for rankings (mirrors production _select_ocr_backend)
858 qwen = None
859 if QwenVLOCRBackend.has_sufficient_vram():
860 print("[rankings] GPU detected — using Qwen2-VL-2B for DR/SA rankings.")
861 qwen = QwenVLOCRBackend()
862 else:
863 print(
864 "[rankings] No GPU / insufficient VRAM — using RapidOCR for DR/SA rankings."
865 )
866
867 test_activeness(rapid)
868 test_chest_contributions(rapid)
869
870 # Find all ranking prefixes dynamically (dr_*, sa_*)
871 dr_prefixes = sorted(
872 {"_".join(p.name.split("_")[:2]) for p in SCREENSHOTS_DIR.glob("dr_*.png")}
873 )
874 sa_prefixes = sorted(
875 {"_".join(p.name.split("_")[:2]) for p in SCREENSHOTS_DIR.glob("sa_*.png")}
876 )
877
878 for prefix in dr_prefixes:
879 test_rankings(
880 rapid, qwen, prefix, f"DREAM REALM — {prefix}", is_supreme_arena=False
881 )
882
883 for prefix in sa_prefixes:
884 test_rankings(
885 rapid, qwen, prefix, f"SUPREME ARENA — {prefix}", is_supreme_arena=True
886 )
887
888
889if __name__ == "__main__":

Callers 1

Calls 6

QwenVLOCRBackendClass · 0.90
test_activenessFunction · 0.85
test_chest_contributionsFunction · 0.85
test_rankingsFunction · 0.85
pp_ocr_v5_recMethod · 0.80
has_sufficient_vramMethod · 0.80

Tested by

no test coverage detected