platypus icon indicating copy to clipboard operation
platypus copied to clipboard

yolo3_generator issue

Open agronomofiorentini opened this issue 2 years ago • 8 comments

Dear creator, I am trying to use your package but have encountered difficulties when using the yolo3_generator function.

The code that give the error is the following

train_blood_yolo_generator <- yolo3_generator(
  annot_path = "C:/Users/Utente/Desktop/platypus/traindataset/train/Annotations/",
  images_path = "C:/Users/Utente/Desktop/platypus/traindataset/train/JPEGImages/",
  net_h = net_h,
  net_w = net_w,
  batch_size = 16,
  shuffle = FALSE,
  labels = blood_labels
)

and the error console output is:

Error in if (input < min_value) { : the condition has length > 1

I have labelled the UAV images by using the labelimg open source software and in order to reproduce the error i will share here a google drive folder where i put the images, annotations and the rcode that i am using.

https://drive.google.com/drive/folders/1U1U_XUgIlNLUvNk5BDbW-VPNJrW6dKkk?usp=sharing

Session information (please complete the following information):

  • OS: [e.g. iOS]: Microsoft 11
  • R version: R version 4.2.0
  • Python version: 3.10.4
  • TensorFlow (Python) version (tensorflow::tf_version()): Loaded Tensorflow version 2.8.0
  • R session information (sessionInfo()):
R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)

Matrix products: default

locale:
[1] LC_COLLATE=Italian_Italy.utf8  LC_CTYPE=Italian_Italy.utf8    LC_MONETARY=Italian_Italy.utf8 LC_NUMERIC=C                   LC_TIME=Italian_Italy.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] abind_1.4-5      platypus_0.1.1   keras_2.9.0      tensorflow_2.9.0 forcats_0.5.1    stringr_1.4.0    dplyr_1.0.9      purrr_0.3.4      readr_2.1.2      tidyr_1.2.0      tibble_3.1.7    
[12] ggplot2_3.3.6    tidyverse_1.3.1 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.8.3       here_1.0.1         lubridate_1.8.0    lattice_0.20-45    prettyunits_1.1.1  png_0.1-7          rprojroot_2.0.3    digest_0.6.29      assertthat_0.2.1   zeallot_0.1.0     
[11] utf8_1.2.2         R6_2.5.1           cellranger_1.1.0   backports_1.4.1    reprex_2.0.1       httr_1.4.3         pillar_1.7.0       tfruns_1.5.0       rlang_1.0.2        progress_1.2.2    
[21] readxl_1.4.0       rstudioapi_0.13    whisker_0.4        Matrix_1.4-1       reticulate_1.25    labeling_0.4.2     munsell_0.5.0      broom_0.8.0        compiler_4.2.0     modelr_0.1.8      
[31] pkgconfig_2.0.3    base64enc_0.1-3    tidyselect_1.1.2   gridExtra_2.3      XML_3.99-0.9       fansi_1.0.3        crayon_1.5.1       tzdb_0.3.0         dbplyr_2.2.0       withr_2.5.0       
[41] rappdirs_0.3.3     grid_4.2.0         jsonlite_1.8.0     gtable_0.3.0       lifecycle_1.0.1    DBI_1.1.2          magrittr_2.0.3     scales_1.2.0       cli_3.3.0          stringi_1.7.6     
[51] farver_2.1.0       fs_1.5.2           xml2_1.3.3         ellipsis_0.3.2     generics_0.1.2     vctrs_0.4.1        RColorBrewer_1.1-3 tools_4.2.0        glue_1.6.2         hms_1.1.1         
[61] colorspace_2.0-3   rvest_1.0.2        haven_2.5.0   

I hope that i provide to you all the information in order to reproduce the error, but if you need more information or data, i am here.

Thanks.

agronomofiorentini avatar Jul 06 '22 13:07 agronomofiorentini

This may be the cause: https://github.com/maju116/platypus/issues/96

wolfpack12 avatar Jul 08 '22 16:07 wolfpack12

so according to issue #96 , what should I do? should I replace the package code?

agronomofiorentini avatar Jul 11 '22 06:07 agronomofiorentini

Hi @agronomofiorentini @wolfpack12 Unfortunately R tensorflow package is not suitable for advanced models like yolo3. I'm currently rewriting platypus to python and then I will create my own R connector. That said for the time being R platypus package won't be modified/fixed.

maju116 avatar Jul 11 '22 07:07 maju116

Ok @maju116, thanks for your effort.

I will wait for news about that cause i would like to test it.

Thanks again

agronomofiorentini avatar Jul 11 '22 07:07 agronomofiorentini

Any news about this issue?

agronomofiorentini avatar Dec 08 '22 21:12 agronomofiorentini

After a lot of work, I’ve realized that R is not the right tool for computer vision tasks. There are lots of very user friendly python models. I’ve used this one extensively and it works great! https://github.com/ultralytics/yolov5

wolfpack12 avatar Dec 08 '22 22:12 wolfpack12

I'm currently working on python version https://github.com/maju116/pyplatypus that will be connected to R @agronomofiorentini @wolfpack12

maju116 avatar Dec 09 '22 08:12 maju116

@wolfpack12 thanks for your suggestion, I will look at it. But I would like to use R because I have developed a pipeline that allows you to automate some processes, but of course after using an object detection process. I do this for research purposes.

agronomofiorentini avatar Dec 09 '22 13:12 agronomofiorentini