From 280656e341cec55b6af73578ded4983e818e94a3 Mon Sep 17 00:00:00 2001 From: zqc <835569504@qq.com> Date: Fri, 7 Nov 2025 17:16:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=B5=8B=E8=AF=95insight=20f?= =?UTF-8?q?ace=E5=AE=89=E8=A3=85=E7=89=88=E6=9C=AC=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/__init__.py | 0 src/face_recognition.py | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/__init__.py create mode 100644 src/face_recognition.py diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/face_recognition.py b/src/face_recognition.py new file mode 100644 index 0000000..daeb1c2 --- /dev/null +++ b/src/face_recognition.py @@ -0,0 +1,40 @@ +# hello_world_advanced.py +""" +Hello World 程序 - Python 3.12 +演示基本语法和新特性 +""" +import torch +import insightface +import cv2 + +def main(): + # 基础输出 + print("Hello, World!") + + print("InsightFace版本:", insightface.__version__) + + # 使用f-string (Python 3.6+) + version = "3.12" + print(f"Running on Python {version}!") + + # 演示Python 3.12的改进错误信息 + try: + # 这里故意创建一个错误来看改进的错误信息 + x = "hello" + y = x + 1 # 这会触发TypeError + except TypeError as e: + print(f"Error demo: {e}") + + # 使用match语句 (Python 3.10+) + language = "Python" + match language: + case "Python": + print("You're using Python! 🐍") + case "Java": + print("You're using Java!") + case _: + print("You're using another language") + + +if __name__ == "__main__": + main() \ No newline at end of file