How to resize or concatenate Blobs using the C++ API

42 views
Skip to first unread message

Victor Hugo

unread,
Jan 30, 2017, 6:33:52 PM1/30/17
to Caffe Users

I’m using a custom data layer provided in a fork to read video frames. This implementation reads images from a directory using OpenCV. Now, I’m modifying this layer to read from HDF5 files instead (because of compression and to avoid exceeding #inodes). However, I’m struggling because the original layer uses Datum, while the Caffe HDF5 loaders output Blob.

I have already done most of it using Blob, but I still have to implement a few functionalities. The original layer provides an option to resize the images using cv::resize. Also, it reads a batch of images and concatenates them along the channel axis, generating a single blob of images.

TL;DR

I’m implementing a custom data layer to read batches of frames from HDF5 files for video processing. I was wondering if there are any functions or examples available that can help me with any of the following:

  1. Given a vector of blobs of the same shape, how can I concatenate/merge them into a single Blob? (I’m currently checking out how concat_layer.cpp does it)
  2. Is there a function to resize/rescale a blob? An equivalent to cv::resize?

Any tips are welcome! =)

Reply all
Reply to author
Forward
0 new messages