User Tools

Site Tools


snapcon2022:image-classification-game

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
snapcon2022:image-classification-game [2022/08/06 13:51] ilgarrasulov001snapcon2022:image-classification-game [2022/08/06 16:55] (current) ali001
Line 1: Line 1:
-====== Image Classification Game ======+====== Image Classification Game: Part 1 ======
 This ** Snap! game **  uses ** Nvidia Jetson ** capability to classify images. This ** Snap! game **  uses ** Nvidia Jetson ** capability to classify images.
  
Line 8: Line 8:
 ===== Snap! files' downloading ===== ===== Snap! files' downloading =====
  
-Please open the link [[https://raw.githubusercontent.com/EOLab-HSRW/Snapcon-workshop/main/snap/snapcon_mlz_final_base.xml|Classification Game]] to download our project on your computer. Probably you would see the xml in raw format. Click the right button of your mouse and save it on the disk.+Please open the link [[https://github.com/EOLab-HSRW/Snapcon-workshop/blob/main/snap/snapcon_mlz_final_pre_project_base.xml|Classification Game]] to download our project on your computer. Probably you would see the xml in raw format. Click the right button of your mouse and save it on the disk.
  
-{{ :snapcon2022:pic_4.jpg?400 |}}+{{ :snapcon2022:pic_4.jpg?600 |}}
  
 ===== Web camera Image in Snap! ===== ===== Web camera Image in Snap! =====
Line 26: Line 26:
   * Use ** connect to Jetson url ** block to connect Jetson. {{ :snapcon2022:pic_1.png?300 |}}   * Use ** connect to Jetson url ** block to connect Jetson. {{ :snapcon2022:pic_1.png?300 |}}
 <WRAP center round info 60%> \\ <WRAP center round info 60%> \\
-You need **ip address** of Nvidia Jetson. You can use // ifconfig // command in a terminal to get **ip address**.+All participants need ** IP address ** of Nvidia Jetson in order to connect.
 </WRAP> </WRAP>
-  * Store the value of ** jetson_name ** in a variable.  {{ :snapcon2022:pic_2.png?300 |}}+  * Store the value of ** jetson_name ** in a variable. {{ :snapcon2022:pic_13.png?300 |}}
   * Store the value of ** connect to Jetson url ** block in a variable for later use.  {{ :snapcon2022:pic_3.png?400 |}}   * Store the value of ** connect to Jetson url ** block in a variable for later use.  {{ :snapcon2022:pic_3.png?400 |}}
 ===== Response from classification  ===== ===== Response from classification  =====
Line 54: Line 54:
 ===== Repeat block for game ===== ===== Repeat block for game =====
 Last step is adding loop for the game. Last step is adding loop for the game.
-{{ :snapcon2022:pic_5.png?400 |}} 
   * Use repeat block and put script inside of it.   * Use repeat block and put script inside of it.
 +{{ :snapcon2022:pic_5.png?400 |}}
 <WRAP center round info 60% > \\  <WRAP center round info 60% > \\ 
 This example used ** repeat until ** block to break loop when // space // key pressed. \\  This example used ** repeat until ** block to break loop when // space // key pressed. \\ 
-You can download full game from [[https://github.com/EOLab-HSRW/Snapcon-workshop/blob/main/snap/Snap!_with_classification.xml | Github page of EOLab-HSRW.]] </WRAP> +You can download full game from [[https://github.com/EOLab-HSRW/Snapcon-workshop/blob/main/snap/snapcon_mlz_final_pre_project.xml | Github page of EOLab-HSRW.]] </WRAP>  
 + 
 +====== Image Classification Game: Part 2====== 
 + 
 +Please open the link [[https://github.com/EOLab-HSRW/Snapcon-workshop/blob/main/snap/snapcon_mlz_final_base.xml|Classification Game: Extended]] to download the extended version of our project on your computer. 
 + 
 +===== Start Camera ===== 
 + 
 +Drag and drop the ** start video ** custom block to start using web camera. 
 + 
 +{{ :snapcon2022:pic_6.png?100 |}} 
 + 
 +===== Connection to Jetson ===== 
 + 
 +Repeat the steps from Part 1 to connect to the Jetson Computer. 
 + 
 +{{ :snapcon2022:pic_13.png?300 |}} 
 + 
 +{{ :snapcon2022:pic_3.png?400 |}} 
 + 
 + 
 +===== Game Initialization ===== 
 +Use ** When flag clicked ** , variable setting and our custom blocks for initializing the game 
 + 
 +{{ :snapcon2022:pic_7.png?300 |}} 
 + 
 +===== Game process control blocks ===== 
 +In the game process we use ** when ** block to catch the click event from the stage and change the current page and broadcasting to tell the other blocks that game is starting. 
 +{{ :snapcon2022:pic_8.png?300 |}} 
 + 
 +Also we added additional blocks to resume the game after it was stopped. 
 +{{ :snapcon2022:pic_9.png?300 |}} 
 + 
 +===== Main part: sending images to Jetson and having fun with our pets:-) ===== 
 + 
 +We use familiar ** when ** block to listen to the start event. Then the block for receiving classification data is used in connection with ** analyze ** block  
 +{{ :snapcon2022:pic10.png?400 |}} 
 +Inside ** analyze ** block we compare the class name with preset class names of food, that our pets consume, and broadcast to them. In case if the detected object is not suitable for any of them, we run ** speak ** block to pronounce the name of the object. 
 +{{ :snapcon2022:pic_11.png?400 |}} 
 + 
 +In the script part of each sprite there are already blocks, responsible for handling their choice events. We use ** speak **, ** play sound **,** animate ** blocks to animate the sprites. 
 +{{ :snapcon2022:pic_12.png?400 |}} 
 + 
 +<WRAP center round info 60% >  
 +You can download full game from [[https://github.com/EOLab-HSRW/Snapcon-workshop/blob/main/snap/snapcon_mlz_final.xml | Github page of EOLab-HSRW.]] </WRAP>  
snapcon2022/image-classification-game.1659786709.txt.gz · Last modified: 2022/08/06 13:51 by ilgarrasulov001