maju116 / platypus

R package for object detection and image segmentation.
MIT License
130 stars 8 forks source link

Bug - error during transforming raw prediction into bounding boxes #93

Open kimhs950627 opened 3 years ago

kimhs950627 commented 3 years ago

Describe the bug I ran the example (BCCD) on Kaggle, and my personal laptop. And I got this error: nm must be NULL or a character vector the same length as x

when I ran the following code: test_boxes<-get_boxes(test_preds, anchors=blood_anchors, labels=blood_labels)

To Reproduce Code and steps to reproduce the behavior:

Below is my entire code. library(platypus) origin_dir<-here::here() BCCD_dir<-file.path(origin_dir, 'BCCD') annot_dir=file.path(BCCD_dir, 'Annotations') img_dir=file.path(BCCD_dir, 'JPEGImages')

blood_labels=c('Platelets', 'RBC', 'WBC') blood_anchors=generate_anchors(anchors_per_grid = 3, annot_path = annot_dir, labels=blood_labels) net_h=416 net_w=416 n_class=length(blood_labels)

test_yolo<-yolo3(net_h = net_h, net_w=net_w, n_class=length(blood_labels), anchors=blood_anchors) test_yolo test_yolo %>% load_model_weights_hdf5(file.path(origin_dir, 'BCCD-yolov3-platypus.h5')) test_image<-list.files(img_dir, full.names = T)[1] #I picked the first image test_img<-image_load(test_image, target_size = c(net_w, net_h)) %>% image_to_array() %>% array_reshape(dim=c(1,net_w, net_h, 3)) test_img=test_img/255 test_preds<-test_yolo %>% predict(test_img) test_boxes<-get_boxes(test_preds, anchors=blood_anchors, labels=blood_labels)

and the following is my session info Session info ----------------------------------- setting value
version R version 4.0.3 (2020-10-10) os Windows 10 x64
system x86_64, mingw32
ui RStudio
language (EN)
collate Korean_Korea.949
ctype Korean_Korea.949
tz Asia/Seoul
date 2021-05-28

[1] C:/Users/Owner/Documents/R/win-library/4.0 [2] C:/Program Files/R/R-4.0.3/library

wolfpack12 commented 2 years ago

Pretty sure this is the root cause. No objects were detected. It’s been assigned as a bug. https://github.com/maju116/platypus/issues/94