mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
Simplified layers and bug fix.
This commit is contained in:
parent
ac88971aff
commit
c3e0e76a5f
2 changed files with 3 additions and 5 deletions
|
@ -147,12 +147,10 @@ namespace rubyopencv {
|
|||
VALUE rb_get_layers(VALUE self) {
|
||||
cv::dnn::Net* selfptr = obj2net(self);
|
||||
|
||||
std::vector<cv::String> layer_names = selfptr->getLayerNames();
|
||||
const long size = layer_names.size();
|
||||
|
||||
long size = selfptr->getLayerNames().size();
|
||||
VALUE layers = rb_ary_new_capa(size);
|
||||
for (long i = 0; i < size; i++) {
|
||||
VALUE layer = Dnn::Layer::layer2obj(selfptr->getLayer(layer_names[i]));
|
||||
VALUE layer = Dnn::Layer::layer2obj(selfptr->getLayer((int)i + 1));
|
||||
rb_ary_store(layers, i, layer);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace rubyopencv {
|
|||
VALUE rb_read_net(int argc, VALUE *argv, VALUE self);
|
||||
VALUE rb_read_net_from_caffe(VALUE self, VALUE prototxt, VALUE caffe_model);
|
||||
VALUE rb_read_net_from_tensorflow(VALUE self, VALUE model, VALUE config);
|
||||
VALUE rb_read_net_from_torch(VALUE self, VALUE model);
|
||||
VALUE rb_read_net_from_torch(int argc, VALUE *argv, VALUE self);
|
||||
VALUE rb_read_net_from_darknet(VALUE self, VALUE cfg_file, VALUE darknet_model);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue