😊 تشخیص چهره - تشخیص صورت ساده در اسکرچ #
The Face Sensing extension brings easy-to-use face detection into Scratch.
It lets your sprites react to face position, tilt, and size – all in real time, right in your browser, with no setup required.
Perfect for beginners and quick interactive projects. 🎭
🌟 مرور کلی #
- Detect 1 Face: Simple single-face detection for streamlined projects.
- 8 Key Points: Track essential facial features (eyes, nose, mouth, ears, and more).
- Control Sprites: Make sprites move to face parts, tilt with your head, or resize based on face size.
- Face Events: Trigger actions when a face is detected, tilted, or when sprites touch facial features.
- Simple & Fast: Lightweight detection optimized for classroom use and quick prototyping.
- Browser-Based: Works entirely in your browser – no external services needed.
✨ ویژگیهای کلیدی #
- Single-face tracking with 8 essential keypoints.
- Easy-to-use blocks for common face interactions.
- Real-time tilt detection (left/right).
- Face size measurement for responsive animations.
- کاملاً در مرورگر کار میکند - ایمن و خصوصی.
- Great for beginners learning AI concepts.
🚀 نحوه استفاده #
- بروید به: pishi.ai/play
- بخش افزونهها را باز کنید.
- Select the Face Sensing extension.
- در صورت درخواست، دسترسی به دوربین را مجاز کنید و بررسی کنید که پیشنمایش ویدیوی شما نمایش داده شود.
- Once the extension loads successfully, automatic face detection starts at approximately 15 frames per second.
- Now you can use the command blocks to make sprites follow your face, mirror your movements, or react when you tilt your head!
نکات
- نورپردازی خوب به مدل کمک میکند تا چهره شما را بهتر تشخیص دهد.
- Face the camera directly for best accuracy.
- The extension works great on most devices, including older computers and Chromebooks.
- Try combining face detection with other Scratch features for creative projects!
🧱 بلوکها و توابع #
📍 بلوکهای دستوری #
go to [PART]
Moves the sprite to a specific facial feature.
[PART]: choose from the dropdown (nose, mouth, left eye, right eye, between eyes, left ear, right ear, or top of head).
The sprite will follow that part as your face moves on screen.
point in direction of face tilt
Sets the sprite’s direction to match your face tilt angle.
Perfect for creating mirroring effects or head-controlled steering.
set size to face size
Adjusts the sprite’s size to match the detected face size.
Get closer to the camera to make sprites bigger, move away to make them smaller.
👋 بلوکهای رویدادی (بلوکهای کلاه) #
when face tilts [DIRECTION]
Triggers when your face tilts left or right.
[DIRECTION]: choose “left” or “right”.
Tilt must exceed 10 degrees from center to trigger.
when this sprite touches a [PART]
Triggers when the sprite touches a specific facial feature.
[PART]: choose any of the 8 facial keypoints.
Great for creating interactive “catch the feature” games.
when a face is detected
Triggers when a face appears in the camera view.
Perfect for starting animations or showing welcome messages.
📊 بلوکهای گزارشی #
a face is detected?
Boolean reporter that returns true when a face is detected, false otherwise.
Use in conditional statements to control program flow.
face tilt
Reports the face tilt angle in degrees (0–180).
90 = facing straight, less than 90 = tilted left, greater than 90 = tilted right.
face size
Reports the detected face height in pixels.
Larger values mean the face is closer to the camera or is a larger face.
😊 اجزای صورت موجود #
The Face Sensing extension can detect 8 key facial features:
- nose – tip of the nose
- mouth – center of the mouth
- left eye – center of the left eye
- right eye – center of the right eye
- between eyes – midpoint between both eyes
- left ear – position of the left ear
- right ear – position of the right ear
- top of head – estimated top of the head (calculated from eye and mouth positions)
Note: “Left” and “right” refer to your left and right when looking at the screen (mirrored view).
🎓 کاربردهای آموزشی #
- Introduction to AI: Show students how computers can recognize and track faces in real time.
- Coordinate Systems: Teach X/Y positioning by linking face parts to sprite locations.
- Event-Driven Programming: Practice using hat blocks that respond to face detection events.
- Accessibility Projects: Create hands-free controllers for students who benefit from alternative input methods.
- Creative Expression: Build interactive art that responds to user presence and movement.
🎮 پروژههای نمونه #
- Face Follower: Make a sprite follow your nose around the screen – great first project!
- Tilt Racer: Tilt your head left or right to steer a car through obstacles.
- Size Mirror: Create a sprite that grows and shrinks as you move closer or farther from the camera.
- Face-Activated Game: Start gameplay only when a face is detected – perfect for multiplayer games.
- Catch the Feature: Control a sprite and try to touch different face parts for points.
- Copycat Animation: Make a character tilt and move along with your face for mirroring effects.
- Magic Mirror: Combine face parts and costume changes to create augmented reality effects.
🧩 خودتان امتحان کنید: pishi.ai/play
🔧 نکات و عیبیابی #
🎯 نکات ویژه تشخیص چهره #
- چهرهای شناسایی نشد؟ Make sure your face is well-lit and fully visible to the camera. Avoid sitting with bright windows behind you.
- Tracking jittery? Try to keep your head relatively still. The extension has built-in smoothing, but sudden movements may cause brief instability.
- Face parts not where expected? Remember the camera view is mirrored – your left appears on the right side of the screen.
- Tilt not triggering? You need to tilt at least 10 degrees left or right from center for the hat block to activate.
- Face size seems wrong? Face size is measured in screen pixels. The value will be larger when you’re closer to the camera.
- Extension slow to load? The first load downloads the AI model. Subsequent uses will be faster thanks to browser caching.
- Sprite not following smoothly? Use “glide” blocks instead of instant “go to” commands for smoother motion.
- Multiple people on camera? The extension tracks only one face – typically the largest or most centered face in view.
🔒 حریم خصوصی و امنیت #
- All face sensing runs locally in your browser.
- No images or video are uploaded or stored.
- The extension only detects simple face movement and does not identify people.
- Ask a teacher or parent before using the camera.
- You can turn the camera off anytime using other camera-based extensions (such as Video Sensing or FaceMesh).
🧪 اطلاعات فنی #
- مدل: MediaPipe Face Detector
- چارچوب: TensorFlow.js with @tensorflow-models/face-detection – runs fully in-browser
- چهرهها: 1 face maximum
- Keypoints: 8 facial landmarks (nose, mouth, eyes, ears, between eyes, top of head)
- Detection Rate: ~15 frames per second (adjusts based on system performance)
- Smoothing: Built-in 5-frame smoothing to prevent false positives
- Tilt Threshold: 10 degrees deviation from center
- مختصات: Stage-centered pixels (X right, Y up)
- Video Format: 480×360 analysis resolution
- نیازمند: Modern browser with WebGL support and camera permissions
🔗 افزونههای مرتبط #
- 😎 FaceMesh – advanced 478-point face landmark detection for detailed expression tracking
- 🖐️ تشخیص دست – detect and track hand positions and gestures
- 🕺 تشخیص بدن – full-body pose detection and tracking
- 🏫 ماشین آموزشپذیر گوگل – train and use custom AI models
- 🖼️ Image Trainer – build your own image recognition models
| ویژگی | Face Sensing ساخت Scratch Lab | FaceMesh ساخت Pishi.ai |
|---|---|---|
| نوع تشخیص | تشخیص سادهٔ مستطیل چهره (فقط محدودهٔ کلی). | تشخیص پیشرفتهٔ نقاط سهبعدی چهره با ۴۷۸ نقطهٔ کلیدی. |
| تعداد چهرههای پشتیبانیشده | ۱ چهره | تا ۴ چهره بهصورت همزمان |
| نقاط کلیدی / نشانهها | هیچکدام (فقط موقعیت و اندازهٔ کلی). | ۴۶۸ نقطهٔ استاندارد + ۱۰ نقطهٔ مخصوص عنبیه (چشمها، لبها، چانه، بینی و ...) |
| ردیابی حالات چهره | محدود - فقط تشخیص «وجود چهره» یا «حرکت». | تحلیل کامل هندسهٔ چهره - قابل اندازهگیری برای لبخند، پلک زدن، باز شدن دهان، چرخش سر یا بالا رفتن ابرو. |
| منبع ورودی | فقط دوربین | دوربین یا تصویر صحنه (برای تحلیل عکسها یا تصاویر گرفتهشده از صفحه). در حالت صحنه، میتوان تصویر دوربین و صحنه را نیز بهصورت همزمان برای تحلیل ترکیبی دستهبندی کرد. |
| کنترل ویدیو | ویدیو را روشن، روشن و آینهای، یا خاموش کنید و میزان شفافیت پیشنمایش ویدیو را تغییر دهید. | پشتیبانی از انتخاب دوربین، بههمراه امکان روشن کردن ویدیو، نمایش آینهای، خاموش کردن و تنظیم شفافیت پیشنمایش ویدیو. |
| تنظیم عملکرد | سرعت ثابت. | حالتهای تشخیص انعطافپذیر - شامل تنظیم بازهٔ تشخیص (هر ۵۰ تا ۲۵۰۰ میلیثانیه)، تشخیص پیوسته یا تشخیص در زمان اجرای بلوک. فرآیند طبقهبندی را میتوان در هر زمان برای کنترل عملکرد یا نمایش آموزشی روشن یا خاموش کرد. |
| حریم خصوصی | بهصورت محلی در مرورگر اجرا میشود. | کاملاً محلی، بدون بارگذاری - همان سطح امنیت، اما حتی پس از بارگذاری مدل بهصورت آفلاین هم کار میکند. |
| تمرکز آموزشی | مقدمهای ساده برای آشنایی با تشخیص چهره. | بررسی عمیق مفاهیم هوش مصنوعی و بینایی ماشین - شامل هندسه، ریاضیات و طراحی تعاملی. |
↔ برای مشاهده جدول کامل در موبایل، صفحه را به چپ یا راست بکشید
💡 چه زمانی Face Sensing را انتخاب کنیم؟ #
Face Sensing is perfect when you want simple, fast face detection without complexity.
- Getting started with AI: Easy blocks make it perfect for beginners and classroom introductions.
- Quick prototypes: Fast setup for testing face-controlled interaction ideas.
- Basic interactions: Following faces, reacting to tilts, and size-based effects are built right in.
- Older devices: Lightweight detection runs smoothly even on Chromebooks and older computers.
- Simple projects: When you don’t need detailed landmark tracking, Face Sensing is faster and easier.
به طور خلاصه:
Face Sensing is ideal for simple, beginner-friendly projects and learning the basics of face detection.
FaceMesh is for creators who need detailed facial landmark tracking and advanced expression analysis.
📚 اطلاعات بیشتر #
- راهنمای افزونههای هوش مصنوعی Pishi.ai
- MediaPipe Face Detector Documentation
- TensorFlow.js Face Detection Model
- ایدههای اسکرچی
