Python Data Layer

This is implemenation of python data layer based on python_layer in caffe.


  1. [-] Add siamese layer, triplet sampling layer implementations[50%]
    1. [ ] Siamese layer
    2. [X] Triplet Layer
  2. [ ] Add free sampling functions / interface to sampling functions in python data layer
  3. [X] Write documents and instructions on how to use these layers (what's the input, what's the output)
  4. [X] List all the options in param_str for python layer

Fileds and Keywords in 'param_str':


These options are used for hard negative sampling:

How to deal with multi-labels

The way to deal with multiple labe is to encode all labels for one sample into a string separated by ":", for example, sample with labels 17, 24, 35 will be encoded into string "17:24:35".

Usage Example:

layer {
  name: "input"
  type: "Python"
  top: "Python1"
  top: "Python2"
  top: "Python3"
  python_param {
    module: "TripletDataLayer"
    layer: "TripletDataLayer"
    param_str: "{\'source_type\': \'CSV\', \'root\': \'../data/ALISC/train_image\', \'batch_size\': 32, \'source\': \'../data/ALISC/train_cat.csv\', \'prefetch\': True, \'type\': \'RANDOM\', \'resize\': [256, 256], \'compressed\': Tru