Skip to content

Commit 42e0fa5

Browse files
committed
Update: replace all the images with correct src in tfjs pt
1 parent 66c3401 commit 42e0fa5

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

projects/make-a-webcam-controlled-game-with-tensorflowjs/make-a-webcam-controlled-game-with-tensorflowjs.mdx

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ author: Dharma Jethva
44
uid: HQImLPf2Tmel6kw8hCis3vcJnLo2
55
datePublished: 2025-11-13
66
published: beta
7-
description: Learn about using WebSocket and Socket.IO to build a chat application.
8-
header:
9-
bannerImage:
7+
description: Learn to create a webcam-controlled game with TensorFlow.js and MediaPipe Hands. Real-time hand tracking and browser ML for interactive web projects.
8+
header:https://firebasestorage.googleapis.com/v0/b/codedex-io.appspot.com/o/projects%2Fmake-a-webcam-controlled-game-with-tensorflowjs%2Fbanner.png?alt=media&token=b216d786-1b40-4526-86ca-5808b36a48b0
9+
bannerImage:https://firebasestorage.googleapis.com/v0/b/codedex-io.appspot.com/o/projects%2Fmake-a-webcam-controlled-game-with-tensorflowjs%2Fbanner.png?alt=media&token=b216d786-1b40-4526-86ca-5808b36a48b0
1010
readTime: 60
1111
prerequisites: JavaScript, async/await, Promises
1212
versions: Browser JavaScript
@@ -35,7 +35,10 @@ How to use hand tracking data to create interactive experiences.
3535

3636
By the end of this tutorial, we’ll have a fully functional gesture-controlled game that looks like this:
3737

38-
<!-- img -->
38+
<img
39+
src="https://firebasestorage.googleapis.com/v0/b/codedex-io.appspot.com/o/projects%2Fmake-a-webcam-controlled-game-with-tensorflowjs%2Fdemo.gif?alt=media&token=e72eaaa2-588a-45f3-aff2-63f7e6cda54a"
40+
alt="Final Project Output"
41+
/>
3942

4043
**Note:** The main focus of this tutorial is understanding how hand tracking works with TensorFlow.js, not building a complex game. The game mechanics are kept simple so we can focus on the machine learning concepts.
4144

@@ -67,7 +70,10 @@ To sum it up, the idea of programming with traditional computer programming is t
6770

6871
So, in summary, the idea of programming with machine learning is that the developers have some input (an image of a hand), they provide the expected output (labeled coordinates for the hand/fingers) to a model, and the model automatically generates the internal rules/patterns necessary to transform the input into that output. In this case, the model is trained with images of hands and the expected coordinates of their landmarks, and as the output, it automatically predicts the coordinates of the landmarks in a new, unseen image.
6972

70-
<!-- img -->
73+
<img
74+
src="https://firebasestorage.googleapis.com/v0/b/codedex-io.appspot.com/o/projects%2Fmake-a-webcam-controlled-game-with-tensorflowjs%2Ftraditional-vs-ml.png?alt=media&token=a85a85cb-2943-4d26-aa63-708c5bfb24eb"
75+
alt="Comparison of Traditional Computing vs Machine Learning"
76+
/>
7177

7278
So, instead of the developers writing the rules, the machine writes the logic for us. Super cool, right?
7379

@@ -87,7 +93,10 @@ This means:
8793

8894
[MediaPipe Hands](https://mediapipe.readthedocs.io/en/latest/solutions/hands.html) is a pre-trained machine learning model created by Google that can detect hands and identify 21 key points (landmarks) on each hand:
8995

90-
<!-- img -->
96+
<img
97+
src="https://firebasestorage.googleapis.com/v0/b/codedex-io.appspot.com/o/projects%2Fmake-a-webcam-controlled-game-with-tensorflowjs%2Fhand-tracking-3d.gif?alt=media&token=af65e486-8ba1-46d7-b782-30e86cc0d460"
98+
alt="MediaPipe model landmark demo"
99+
/>
91100

92101

93102
These 21 landmarks include:
@@ -363,7 +372,10 @@ const handPositions = hands.map(hand => {
363372
});
364373
```
365374

366-
<!-- img -->
375+
<img
376+
src="https://firebasestorage.googleapis.com/v0/b/codedex-io.appspot.com/o/projects%2Fmake-a-webcam-controlled-game-with-tensorflowjs%2Fhand-landmarks.png?alt=media&token=0431ba4f-708c-4c5d-b931-68b474d883d2"
377+
alt="Hand landmark information with indexing"
378+
/>
367379

368380

369381
**Why these calculations?**
@@ -499,7 +511,10 @@ if (!success) {
499511
- Shows friendly error message.
500512
- Prevent the game from starting without hand tracking.
501513
-
502-
<!-- img -->
514+
<img
515+
src="https://firebasestorage.googleapis.com/v0/b/codedex-io.appspot.com/o/projects%2Fmake-a-webcam-controlled-game-with-tensorflowjs%2Fdemo.gif?alt=media&token=e72eaaa2-588a-45f3-aff2-63f7e6cda54a"
516+
alt="Final Project Output"
517+
/>
503518
504519
### How the Game Works (Optional)
505520

0 commit comments

Comments
 (0)