Skip to main content

You look only once v1

 YOLO really changed the game when it comes to object detection! Back in the day, we had to use the sliding window method at different scales and apply an image classifier. The method was imprecise and very slow, and it was not really possible to run it in real-time on videos, for example. YOLO (You Only Look Once) changed everything by predicting everything at once, making it possible to run it in real-time while being small enough to fit in a mobile application.

The first YOLO model came out in 2015, and YOLO v9 came out last week. There have been many improvements over the years, but there are common features that persist. The idea is to segment the image into a grid and predict the existence of a bounding box for each of the classes we are considering. When it comes to labeling the data, a grid cell is labeled to contain an object only if the center of the box is in it. If the grid cell contains a center, the "objectness" is labeled 1 and 0 otherwise. The model will try to predict the probability that a grid cell contains a center. If it contains a center or multiple ones, each class related to those centers will be labeled with 1s. If we have 2 classes (e.g., cat and dog), the label vector will be [1, 1, 0] if the grid cell contains a cat, [1, 1, 1] if the grid cell contains a cat and a dog, and [0, 0, 0] if it contains nothing. Added to that, the label vector holds as well the (x, y) coordinates of the box centers for each class and their sizes (w, h): [x, y, w, h, x', y', w', h', 1, 1, 0]. The full target to predict is the set of label vectors for each grid cell. The full target includes multiple box priors, expanding the target dimensionality. Those priors are anchor boxes that guide the model with a set of typical box shapes seen in the data. For example, V2 uses 5 different priors with a grid of 13 x 13, making the target a tensor of 13 x 13 x 11 x 5 = 9295 parameters. 


The model is a simple convolutional network with the output of the last conv layer having the dimensionality of the target. This means that for each cell, the model will predict if there is an object, the probability for each class, and the dimensions and positions of the resulting bounding boxes for each prior.Because the model will likely predict multiple bounding boxes for the same object, it is necessary to select the best ones. The idea is to choose the box with the highest confidence score, measure its intersection area over union area (IOU) with all the other overlapping boxes of the same class, and remove all that are above a certain threshold. This is called non-maximum suppression. This ensures that boxes with high overlaps are merged into one.

Here is the paper for YOLO v1: https://arxiv.org/pdf/1506.02640, and here for YOLO v9: https://arxiv.org/pdf/2402.13616.



Comments

Popular posts from this blog

የዕለቱ ወንጌል ሐምሌ 5

  05/11/2016 /ጴጥሮስ ወጳውሎስ ብርሃናተ ዓለም 72 አርድእት ወይስሐቅ ሰማእት/                       የዕለቱ የወንጌል ክፍል                          ዮሐንስ 21:15-20      ምሳ ከበሉ በኋላም ኢየሱስ ስምዖን ጴጥሮስን፦ “የዮና ልጅ ስምዖን ሆይ፥ ከእነዚህ ይልቅ ትወደኛለህን?” አለው። “አዎን ጌታ ሆይ፥ እንድወድህ አንተ ታውቃለህ” አለው።“ግልገሎቼን አሰማራ፡” አለው። ደግሞ ሁለተኛ፦ “የዮና ልጅ ስምዖን ሆይ፥ ትወደኛለህን?” አለው። “አዎን ጌታ ሆይ፥ እንድወድህ አንተ ታውቃለህ፡” አለው። “ጠቦቶቼን ጠብቅ፡” አለው። ሦስተኛ ጊዜ፦ “የዮና ልጅ ስምዖን ሆይ፥ ትወደኛለህን?” አለው። ሦስተኛ፦ “ትወደኛለህን?” ስላለው ጴጥሮስ አዘነና፦ “ጌታ ሆይ፥ አንተ ሁሉን ታውቃለህ፤ እንድወድህ አንተ ታውቃለህ፡” አለው። ኢየሱስም አለው፦ “በጎቼን አሰማራ። እውነት እውነት እልሃለሁ፥ አንተ ጐልማሳ ሳለህ ወገብህን በገዛ ራስህ ታጥቀህ ወደምትወደው ትሄድ ነበር፤ ነገር ግን በሸመገልህ ጊዜ እጆችህን ትዘረጋለህ፥ ሌላውም ያስታጥቅሃል ወደማትወደውም ይወስድሃል።” በምን ዓይነት ሞት እግዚአብሔርን ያከብር ዘንድ እንዳለው ሲያመለክት ይህን አለ። ይህንም ብሎ፦ “ተከተለኝ፡” አለው።        ...

ወንጌል ዘሐምሌ 6

 ዕርገቱ ለዕዝራ ነቢይ ወንስተሮኒን ወአልሞድያስ ወሥርቀተ ተሙዝ ወዮልዮህ ወተዝካረ በርተሎሜዎስ ወ፲፻ ሰማዕታት ወከላድያን ሊቀ ጳጳሳት                      06/11/2016                    የዕለቱ የወንጌል ክፍል     “እንግዲህ በነቢዩ በዳንኤል የተባለውን የጥፋትን ርኩሰት በተቀደሰችው ስፍራ ቆሞ ስታዩ፥ አንባቢው ያስተውል፥ በዚያን ጊዜ በይሁዳ ያሉት ወደ ተራራዎች ይሽሹ፥ በሰገነትም ያለ በቤቱ ያለውን ሊወስድ አይውረድ፥ በእርሻም ያለ ልብሱን ይወስድ ዘንድ ወደ ኋላው አይመለስ። በዚያችም ወራት ለርጉዞችና ለሚያጠቡ ወዮላቸው። ነገር ግን ሽሽታችሁ በክረምት ወይም በሰንበት እንዳይሆን ጸልዩ፤ “በዚያን ጊዜ ከዓለም መጀመሪያ ጀምሮ እስከ ዛሬ ድረስ ያልሆነ እንግዲህም ከቶ የማይሆን ታላቅ መከራ ይሆናልና። እነዚያ ቀኖችስ ባያጥሩ ሥጋ የለበሰ ሁሉ ባልዳነም ነበር፤ ነገር ግን እነዚያ ቀኖች ስለ ተመረጡት ሰዎች ያጥራሉ። በዚያን ጊዜ ማንም፦ እነሆ፥ ክርስቶስ ከዚህ አለ፡ ወይም፦ ከዚያ አለ፡ ቢላችሁ አትመኑ፤ ሐሰተኞች ክርስቶሶችና ሐሰተኞች ነቢያት ይነሣሉና፥ ቢቻላቸውስ የተመረጡትን እንኳ እስኪያስቱ ድረስ ታላላቅ ምልክትና ድንቅ ያሳያሉ። እነሆ፥ አስቀድሜ ነገርኋችሁ። እንግዲህ፦ ‘እነሆ፥ በበረሀ ነው’ ቢሉአችሁ፥ አትውጡ፤ ‘እነሆ፥ በእልፍኝ ነው’ ቢሉአችሁ፥ አትመኑ፤ መብረቅ ከምሥራቅ ወጥቶ እስከ ምዕራብ እንደሚታይ፥...

የዕለቱ ወንጌል ሐምሌ 7:

 አባ ሲኖዳ ወአግናጥዮስ ሊቀ ጳጳሳት አባ ጊዮርጊስ ወመቃቢስ ወአግራጥስ ወቦኡ ሥሉስ ቅዱስ ቤተ አብርሃም የዕለቱ ወንጌል ሐምሌ 7: ዮሐ  8:51-59 ፶፩እውነት እውነት እላችኋለሁ፥ ቃሌን የሚጠብቅ ቢኖር ለዘላለም ሞትን አያይም።፶፪አይሁድ። ጋኔን እንዳለብህ አሁን አወቅን። አብርሃም ስንኳ ሞተ ነቢያትም፤ አንተም። ቃሌን የሚጠብቅ ቢኖር ለዘላለም ሞትን አይቀምስም ትላለህ።፶፫በእውኑ አንተ ከሞተው ከአባታችን ከአብርሃም ትበልጣለህን? ነቢያትም ሞቱ፤ ራስህን ማንን ታደርጋለህ? አሉት።፶፬ኢየሱስም መለሰ አለም። እኔ ራሴን ባከብር ክብሬ ከንቱ ነው፤ የሚያከብረኝ እናንተ አምላካችን የምትሉት አባቴ ነው፤፶፭አላወቃችሁትምም፥ እኔ ግን አውቀዋለሁ። አላውቀውም ብል እንደ እናንተ ሐሰተኛ በሆንሁ፤ ዳሩ ግን አውቀዋለሁ ቃሉንም እጠብቃለሁ።፶፮አባታችሁ አብርሃም ቀኔን ያይ ዘንድ ሐሤት አደረገ፥ አየም ደስም አለው።፶፯አይሁድም። ገና አምሳ ዓመት ያልሆነህ አብርሃምን አይተሃልን? አሉት።፶፰ኢየሱስም። እውነት እውነት እላችኋለሁ፥ አብርሃም ሳይወለድ እኔ አለሁ አላቸው።፶፱ስለዚህ ሊወግሩት ድንጋይ አነሡ፤ ኢየሱስ ግን ተሰወራቸው ከመቅደስም ወጥቶ በመካከላቸው አልፎ ሄደ ።"" ሮሜ9:1-17 ፩-፪ብዙ ኀዘን የማያቋርጥም ጭንቀት በልቤ አለብኝ ስል በክርስቶስ ሆኜ እውነትን እናገራለሁ፤ አልዋሽምም፤ ሕሊናዬም በመንፈስ ቅዱስ ይመሰክርልኛል።፫በሥጋ ዘመዶቼ ስለ ሆኑ ስለ ወንድሞቼ ከክርስቶስ ተለይቼ እኔ ራሴ የተረገምሁ እንድሆን እጸልይ ነበርና ..."" 1ኛዮሐ 4:11-21 የሐዋ 11:11-19 ምስባክ መዝ 27:8-9 ወሐሠሥኩ ገጽከ ገጸ ዚአከ አሐሥሥ እግዚኦ ወኢትሚጥ ገጸከ እምኔየ ፰አንተ ፊቴን እሹት ባልህ ጊዜ። አቤቱ፥ ፊትህን እሻለሁ ልቤ አንተን አለ።፱ፊትህ...