Is there someone who has used bnosac/image YOLO package

rstudio
package-installation

#1

Hello All

I am trying to install bnosac/ image from GIT but it's ending with error. I am using community edition of RStudio.

Installing instructions are given at following URL

Please someone help...


Mentioning two users in this thread
#2

Hey @bramhe

You should post the error message you're getting.


#3

Hi, and welcome to the RStudio Community!

I would suggest waiting until January if you want to use YOLO in R, because the brilliant Sigrid Keydana, Andrie De Vries and Kevin Kuo are going to show a working implementation of YOLO in R at the RStudio::conf! Also, currently there are simpler (but not cooler!) ways to do object detection in R than using YOLO.

However, if you a) can't wait until January and b) really want to use YOLO, then let's try to get this fixed, since I'm a big YOLO fan! (though I use YOLO v3 in Python and not Tiny YOLO in R). What error are you getting, exactly? Can you create a reprex?


#4

Hi all,

in the workshop description it says

Overview of object detection

  • Understand how to detect where an object is located inside an image
  • The essentials of YOLO (you only look once) and SSD (single shot detection)

... which is not the same as "a working implementation of YOLO in R" :slight_smile:

We will want to focus on principles, and not to get lost in implementation details, so as to the coding part, we'll leave it open for now.
So please don't rely on that (although we appreciate the advertising :-))


#5

I'm able to replicate the instructions at Object detection in just 3 lines of R code using Tiny YOLO and don't have any problems.

This is the R code in the instructions:

#install.packages("devtools") If devtools is not available
# devtools::install_github("bnosac/image", subdir = "image.darknet", build_vignettes = TRUE)

library(image.darknet)

google_car <- tempfile(fileext = ".jpg")
download.file("https://cdn-images-1.medium.com/max/1600/1*vOB-yPySUl_07EU1v7iDpQ.png", destfile = google_car)


yolo_tiny_voc <- image_darknet_model(
  type = "detect", 
  model = "tiny-yolo-voc.cfg", 
  weights = system.file(package="image.darknet", "models", "tiny-yolo-voc.weights"), 
  labels = system.file(package="image.darknet", "include", "darknet", "data", "voc.names")
)

x <- image_darknet_detect(
  file = google_car, 
  object = yolo_tiny_voc,
  threshold = 0.19
)

And here are my results:

/tmp/RtmpZZgAoN/file30e944fafe77.jpg: Predicted in 3.217825 seconds.
Boxes: 845 of which 4 above the threshold.
person: 24%
car: 96%
person: 40%
bicycle: 50%

Note that image_darknet_detect() has the side effect of writing a file called predictions.png in the working directory:

And my session info:

sessioninfo::session_info()
─ Session info ────────────────────────────────────────────────────────────────────────────────
 setting  value                                      
 version  R version 3.4.3 Patched (2018-03-01 r74338)
 os       Ubuntu 14.04.5 LTS                         
 system   x86_64, linux-gnu                          
 ui       RStudio                                    
 language (EN)                                       
 collate  en_US.UTF-8                                
 ctype    en_US.UTF-8                                
 tz       Etc/UTC                                    
 date     2018-10-10                                 

─ Packages ────────────────────────────────────────────────────────────────────────────────────
 package       * version  date       lib source                       
 assertthat      0.2.0    2017-04-11 [1] RSPM (R 3.4.3)               
 cli             1.0.0    2017-11-05 [1] RSPM (R 3.4.3)               
 crayon          1.3.4    2017-09-16 [1] CRAN (R 3.4.0)               
 curl            3.1      2017-12-12 [1] RSPM (R 3.4.3)               
 devtools        1.13.5   2018-02-18 [2] CRAN (R 3.4.3)               
 digest          0.6.15   2018-01-28 [1] RSPM (R 3.4.3)               
 git2r           0.21.0   2018-01-04 [2] CRAN (R 3.4.3)               
 httr            1.3.1    2017-08-20 [1] RSPM (R 3.4.3)               
 igraph          1.1.2    2017-07-21 [1] RSPM (R 3.4.3)               
 image.darknet * 0.1.0    2018-10-10 [1] Github (bnosac/image@1803a6a)
 magrittr        1.5      2014-11-22 [1] RSPM (R 3.4.4)               
 memoise         1.1.0    2017-04-21 [2] CRAN (R 3.4.3)               
 miniCRAN      * 0.2.11   2018-01-15 [1] RSPM (R 3.4.3)               
 pkgconfig       2.0.1    2017-03-21 [1] RSPM (R 3.4.3)               
 R6              2.2.2    2017-06-17 [1] RSPM (R 3.4.3)               
 rstudioapi      0.7      2017-09-07 [1] CRAN (R 3.4.0)               
 sessioninfo     1.1.0    2018-09-25 [1] RSPM (R 3.4.3)               
 withr           2.1.1    2017-12-19 [1] RSPM (R 3.4.3)               
 XML             3.98-1.9 2017-06-19 [1] RSPM (R 3.4.3)  

#6

Ehm, sorry, I must have misunderstood this GitHub issue comment about an R implementation of YOLO:

I thought you were talking about a YOLO implementation! My mistake.


#7

No, it's entirely my mistake :slight_smile:

I shouldn't have written that in the github issue!


#8

I will remove it, actually, and link to this implementation instead.