{"id":6297,"date":"2022-11-04T17:39:03","date_gmt":"2022-11-04T16:39:03","guid":{"rendered":"https:\/\/dronesonen.usn.no\/?p=6297"},"modified":"2022-11-29T08:27:52","modified_gmt":"2022-11-29T07:27:52","slug":"group-2-week-11","status":"publish","type":"post","link":"https:\/\/dronesonen.usn.no\/?p=6297","title":{"rendered":"Group 2 &#8211; Week 11"},"content":{"rendered":"\n<p>On Monday I met with Richard to get some help with the design of the spur gears. And it turns out that all the math I have been trying to get right, is something I don\u2019t have to focus on. So yeah.. that\u2019s 10 hours of my life I will not get back.<\/p>\n\n\n\n<p>I have also, alongside doing some finishing touches on the design of the spur gear, started to print all the parts for the arm and base. Three of the parts where too big for my printer, so I ended up sending the files to Richard for print.<\/p>\n\n\n\n<p>By Wednesday all the parts I sent to Richard was finished, and I started to put everything together. Kevin has started to code the prototype, and he wanted to continue with the coding. So, I put together all the parts that I could put together, and I will continue next Wednesday when I can get the rest of the parts from the prototype.<\/p>\n\n\n\n<p>Since the first chess board I made turned out to be a little bit too small, I had to make a new board, and started to cut out all the parts I needed on Wednesday morning. On Friday I engraved the tiles on the chess board.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"379\" height=\"505\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-5.png\" alt=\"\" class=\"wp-image-6298\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-5.png 379w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-5-225x300.png 225w\" sizes=\"auto, (max-width: 379px) 100vw, 379px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"376\" height=\"502\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-6.png\" alt=\"\" class=\"wp-image-6299\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-6.png 376w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-6-225x300.png 225w\" sizes=\"auto, (max-width: 376px) 100vw, 376px\" \/><\/figure>\n\n\n\n<p>Workhours this week: 10.5 hours. Excluding the 3D printing and the time worked on the gears.<\/p>\n\n\n\n<p>Mechanical Engineering \u2013 Liv Marte Olsen.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Computer Vision<\/h2>\n\n\n\n<h5 class=\"wp-block-heading\">PAINTING CHESSPIECES<\/h5>\n\n\n\n<p>Since we found out last week that the chess pieces had some of the magnets facing the wrong way, Liv Marte had to open them up end turn them. Some pieces got broken in the process and she printed some new ones that I painted to get them ready for the modification I wanted to do to my dataset this week. Painting took about 1,5 hours<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h5 class=\"wp-block-heading\">nEW IMAGES TO IMPROVE HEALTH CHECK<\/h5>\n\n\n\n<p>To improve the \u00abhealth\u00bb of my dataset I sat down and calculated how many more of each class I needed. I wanted to aim for about 250 annotation per class and in the new pictures I needed to include:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>2 Black Rooks<\/li><li>20 Black Bishops<\/li><li>38 Black Kings<\/li><li>48 White Queens<\/li><li>56 Black Queens<\/li><li>77 Flipped Pieces<\/li><li>80 White Kings<\/li><\/ul>\n\n\n\n<p>This ended up being around 100 pictures all together and this took me about an hour.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h5 class=\"wp-block-heading\">aNNOTATING THE LAST IMAGES BEFORE TRAINING<\/h5>\n\n\n\n<p>I annotated all the last images in about 3,5 hours. Now the health of the dataset is a lot better as you can see on the image below. I have also added some \u201cempty\u201d pictures to the set, so it doesn\u2019t learn that there always have to be something in frame. Now that it\u2019s all done, I must send it away for training, which takes about 24 hours.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"402\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/9-1024x402.jpg\" alt=\"\" class=\"wp-image-6806\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/9-1024x402.jpg 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/9-300x118.jpg 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/9-768x302.jpg 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/9.jpg 1112w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h5 class=\"wp-block-heading\">PRE-PROCESSING AND AUGMENTATION STEPS<\/h5>\n\n\n\n<p>Before you send the model away for training, you are able to add some augmentation steps to all the images, and some prepossessing steps before this. This will allow each image I have annotated to be used more than one time, since each augmentation steps I add tweaks the images a tiny bit, and then adds those images to the set.<br><\/p>\n\n\n\n<p><strong>Pre-processing steps I added:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Resize: Stretch to 416&#215;416<\/li><li>Grayscale: Applied<\/li><\/ul>\n\n\n\n<p><strong>Augmentation steps I added:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Flip: Horizontal, Vertical<\/li><li>90\u00b0 Rotate: Clockwise, Counter-Clockwise, Upside Down<\/li><li>Crop: 0% Minimum Zoom, 20% Maximum Zoom<\/li><li>Rotation: Between -15\u00b0 and +15\u00b0<\/li><li>Shear: \u00b115\u00b0 Horizontal, \u00b115\u00b0 Vertical<\/li><li>Hue: Between -25\u00b0 and +25\u00b0<\/li><li>Brightness: Between -25% and +25%<\/li><\/ul>\n\n\n\n<p>After these steps the dataset now includes 985 images.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h5 class=\"wp-block-heading\">rESULTS FROM TRAINING<\/h5>\n\n\n\n<p>By the time I arrived at school at 09.00 on Wednesday my model was done training, so I got to test it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"793\" height=\"79\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/10.jpg\" alt=\"\" class=\"wp-image-6808\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/10.jpg 793w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/10-300x30.jpg 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/10-768x77.jpg 768w\" sizes=\"auto, (max-width: 793px) 100vw, 793px\" \/><\/figure>\n\n\n\n<p><strong>WHAT DOES mAP MEAN?<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote has-tertiary-background-color has-background is-layout-flow wp-block-quote-is-layout-flow\"><p><strong><em>On the image above you can see something called mAP. The abbreviation mAP stands for Mean Average Precision. It is employed to gauge how well computer vision models are doing. mAP is the same as the average of the Average Precision metric across all classes in a model. <\/em><\/strong><\/p><cite><a href=\"https:\/\/blog.roboflow.com\/mean-average-precision\/\">https:\/\/blog.roboflow.com\/mean-average-precision\/<\/a><\/cite><\/blockquote>\n\n\n\n<p>As you can see in the image the results are pretty accurate, but they are a little too accurate to be honest, and I do believe that the reason for this is that I ended up with too few images for validation and testing. These images are only about 12% of all the images, and if I have time to adjust this before we are done with the project I will add more images to these two parts.<\/p>\n\n\n\n<p>After the training you are able to test it directly in your browser with a webcam and it was really cool to see it in action.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"828\" height=\"549\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/11.jpg\" alt=\"\" class=\"wp-image-6813\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/11.jpg 828w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/11-300x199.jpg 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/11-768x509.jpg 768w\" sizes=\"auto, (max-width: 828px) 100vw, 828px\" \/><\/figure>\n\n\n\n<p>Above you see the results when testen on a picture, and on the right side you see the outputs we need to access in our code to determine where each piece is. <\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/CV.mp4\"><\/video><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h5 class=\"wp-block-heading\">MODIFICATIONS IN THE FUTURE<\/h5>\n\n\n\n<p>Possible modifications I will do to the set in the future if I have time for it, would include:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>More validation and training images as mentioned above.<\/li><li>More pictures of the Knight and the Bishop pieces, as these have a small chance of mixing with each other.<\/li><li>Remove the \u201cFlipped\u201d class, as I don\u2019t think we will have use for it.<\/li><li>More NULL examples, meaning more empty images, as it still finds some pieces where there aren\u2019t any in frame. &nbsp;<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<p><strong><em>Hours on the project this week: 10<\/em><\/strong><\/p>\n\n\n\n<p><strong><em>Marte Marheim, Computer Science<\/em><\/strong><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Etter \u00e5 ha hjulpet med setup til prototypen(1-2timer med sm\u00e5feil ogs\u00e5nt), s\u00e5 sjekket jeg videre p\u00e5 plotting av bilder av sjakkbrettet, det er ikke s\u00e5 lett som det virket som, ettersom jeg m\u00e5 f\u00e5 vite forandring i bilder, eller forandring i x &#8211; y p\u00e5 brikkene fra bildet. Har sjekket p\u00e5 MSE som st\u00e5r for mean squared error, det er visst en algoritme som man kan bruke for \u00e5 se forskjell p\u00e5 bilder, etter en del unders\u00f8kelse(1-2timer), s\u00e5 fant jeg ut at det blir vanskelig \u00e5 implementere siden det vil bare fortelle forandring i bildene, noe som <em>kan <\/em>v\u00e6re eventuelt \u00e5 bruke om: Kamera tar bilder hele tiden ogs\u00e5 kun n\u00e5r en forandring har skjedd i bildet s\u00e5 vil den faktisk &#8220;ta tak&#8221; i bildet og f\u00f8rst da produsere nye x -y verdier. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"635\" height=\"538\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/sss11112222.png\" alt=\"\" class=\"wp-image-7231\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/sss11112222.png 635w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/sss11112222-300x254.png 300w\" sizes=\"auto, (max-width: 635px) 100vw, 635px\" \/><\/figure>\n\n\n\n<p>S\u00e5 jeg bestemte meg heller for \u00e5 lage et mal for n\u00e5r datasettet(roboflow) er klar for \u00e5 plassere ting inn, jeg vet ihvertfall at det produseres x og y p\u00e5 hver enkelt brikke i roboflow datasettet. s\u00e5 alt jeg m\u00e5 gj\u00f8re err \u00e5 f\u00e5 ut den dataen n\u00e5r jeg for tak i koden\/api key til roboflow<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"378\" height=\"429\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/ssss3331.png\" alt=\"\" class=\"wp-image-7232\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/ssss3331.png 378w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/ssss3331-264x300.png 264w\" sizes=\"auto, (max-width: 378px) 100vw, 378px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/dronesonen.usn.no\/36fbb0c3-b027-46ee-9872-2805a59cb391\" class=\"wp-block-file__button\" download>Download<\/a><\/div>\n\n\n\n<p>Hossein Sadeghi, Computer Science<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<p>Programmering av armen:<\/p>\n\n\n\n<p>Fortsatt en del feil med bevegelsene til prototype armen. Servomotoren p\u00e5 midterste ledd ble byttet. Hver av motorene ser ut til \u00e5 fungere hver for seg men ikke for eksempel 2 samtidig. De to nederste er viktigst \u00e5 f\u00e5 til \u00e5 fungere samtidig f\u00f8rst. Her er forel\u00f8pig kode for arm: <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"450\" height=\"746\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-66.png\" alt=\"\" class=\"wp-image-7195\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-66.png 450w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-66-181x300.png 181w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"502\" height=\"588\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-67.png\" alt=\"\" class=\"wp-image-7196\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-67.png 502w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-67-256x300.png 256w\" sizes=\"auto, (max-width: 502px) 100vw, 502px\" \/><\/figure>\n\n\n\n<p>Skiller mellom servo objekter for de 2 nederste servomotorene (avsluttes med B1 og B2), den midterste (avsluttes med M), og det \u00f8verste leddet (avsluttes med T). Her er hovedloopen som jeg driver \u00e5 tester ut:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"332\" height=\"764\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-68.png\" alt=\"\" class=\"wp-image-7197\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-68.png 332w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-68-130x300.png 130w\" sizes=\"auto, (max-width: 332px) 100vw, 332px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"437\" height=\"453\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-69.png\" alt=\"\" class=\"wp-image-7198\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-69.png 437w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2022\/11\/image-69-289x300.png 289w\" sizes=\"auto, (max-width: 437px) 100vw, 437px\" \/><\/figure>\n\n\n\n<p>Kevin Johansen &#8211; Computer science<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On Monday I met with Richard to get some help with the design of the spur gears. And it turns out that all the math I have been trying to get right, is something I don\u2019t have to focus on. So yeah.. that\u2019s 10 hours of my life I will not get back. I have [&hellip;]<\/p>\n","protected":false},"author":88,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[95,93,1],"tags":[87,89],"class_list":["post-6297","post","type-post","status-publish","format-standard","hentry","category-chess-mates","category-smart-systems-2022","category-uncategorized","tag-chess-mates","tag-smarte-systemer-2022"],"_links":{"self":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/6297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/users\/88"}],"replies":[{"embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6297"}],"version-history":[{"count":25,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/6297\/revisions"}],"predecessor-version":[{"id":7233,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/6297\/revisions\/7233"}],"wp:attachment":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}