Skip to content

Commit

Permalink
* Let users choose the runtime type of layer_by_name() from `Float…
Browse files Browse the repository at this point in the history
…Net` or `DoubleNet` in `caffe` (issue bytedeco/javacpp#25)
  • Loading branch information
saudet committed Aug 1, 2015
1 parent 399b278 commit 5f7d393
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Let users choose the runtime type of `layer_by_name()` from `FloatNet` or `DoubleNet` in `caffe` ([issue bytedeco/javacpp#25](https://github.com/bytedeco/javacpp/issues/25))
* Add presets for the `face` and `xfeatures2d` modules of OpenCV 3.0 ([issue #54](https://github.com/bytedeco/javacpp-presets/issues/54))
* Switch to GCC 4.9 by default on Android, probably dropping support for Android 2.2, because GCC 4.6 has issues with OpenMP ([issue bytedeco/javacv#179](https://github.com/bytedeco/javacv/issues/179))
* Resolve missing dependency for GSL on `windows-x86` by linking statically whatever it needs from `libgcc_s_dw2-1.dll`
Expand Down
12 changes: 8 additions & 4 deletions caffe/src/main/java/org/bytedeco/javacpp/caffe.java
Original file line number Diff line number Diff line change
Expand Up @@ -16124,8 +16124,10 @@ public FloatNet() { }
public native @Const @SharedPtr @ByVal FloatBlob blob_by_name(@StdString String blob_name);
public native @Cast("bool") boolean has_layer(@StdString BytePointer layer_name);
public native @Cast("bool") boolean has_layer(@StdString String layer_name);
public native @Const @Cast({"", "boost::shared_ptr<caffe::Layer<float> >"}) @SharedPtr @ByVal FloatLayer layer_by_name(@StdString BytePointer layer_name);
public native @Const @Cast({"", "boost::shared_ptr<caffe::Layer<float> >"}) @SharedPtr @ByVal FloatLayer layer_by_name(@StdString String layer_name);
public FloatLayer layer_by_name(BytePointer layer_name) { return layer_by_name(FloatLayer.class, layer_name); }
public FloatLayer layer_by_name(String layer_name) { return layer_by_name(FloatLayer.class, layer_name); };
public native @Const @Cast({"", "boost::shared_ptr<caffe::Layer<float> >"}) @SharedPtr @ByVal <L extends FloatLayer> L layer_by_name(Class<L> cls, @StdString BytePointer layer_name);
public native @Const @Cast({"", "boost::shared_ptr<caffe::Layer<float> >"}) @SharedPtr @ByVal <L extends FloatLayer> L layer_by_name(Class<L> cls, @StdString String layer_name);

public native void set_debug_info(@Cast("const bool") boolean value);

Expand Down Expand Up @@ -16287,8 +16289,10 @@ public DoubleNet() { }
public native @Const @SharedPtr @ByVal DoubleBlob blob_by_name(@StdString String blob_name);
public native @Cast("bool") boolean has_layer(@StdString BytePointer layer_name);
public native @Cast("bool") boolean has_layer(@StdString String layer_name);
public native @Const @Cast({"", "boost::shared_ptr<caffe::Layer<double> >"}) @SharedPtr @ByVal DoubleLayer layer_by_name(@StdString BytePointer layer_name);
public native @Const @Cast({"", "boost::shared_ptr<caffe::Layer<double> >"}) @SharedPtr @ByVal DoubleLayer layer_by_name(@StdString String layer_name);
public DoubleLayer layer_by_name(BytePointer layer_name) { return layer_by_name(DoubleLayer.class, layer_name); }
public DoubleLayer layer_by_name(String layer_name) { return layer_by_name(DoubleLayer.class, layer_name); };
public native @Const @Cast({"", "boost::shared_ptr<caffe::Layer<double> >"}) @SharedPtr @ByVal <L extends DoubleLayer> L layer_by_name(Class<L> cls, @StdString BytePointer layer_name);
public native @Const @Cast({"", "boost::shared_ptr<caffe::Layer<double> >"}) @SharedPtr @ByVal <L extends DoubleLayer> L layer_by_name(Class<L> cls, @StdString String layer_name);

public native void set_debug_info(@Cast("const bool") boolean value);

Expand Down
13 changes: 12 additions & 1 deletion caffe/src/main/java/org/bytedeco/javacpp/presets/caffe.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ public void map(InfoMap infoMap) {

.put(new Info("std::vector<bool>").pointerTypes("BoolVector").define())
.put(new Info("std::vector<std::vector<bool> >").pointerTypes("BoolVectorVector").define())
.put(new Info("std::map<std::string,int>").pointerTypes("StringIntMap").define());
.put(new Info("std::map<std::string,int>").pointerTypes("StringIntMap").define())

.put(new Info("caffe::Net<float>::layer_by_name").javaText(
"public FloatLayer layer_by_name(BytePointer layer_name) { return layer_by_name(FloatLayer.class, layer_name); }\n"
+ "public FloatLayer layer_by_name(String layer_name) { return layer_by_name(FloatLayer.class, layer_name); };\n"
+ "public native @Const @Cast({\"\", \"boost::shared_ptr<caffe::Layer<float> >\"}) @SharedPtr @ByVal <L extends FloatLayer> L layer_by_name(Class<L> cls, @StdString BytePointer layer_name);\n"
+ "public native @Const @Cast({\"\", \"boost::shared_ptr<caffe::Layer<float> >\"}) @SharedPtr @ByVal <L extends FloatLayer> L layer_by_name(Class<L> cls, @StdString String layer_name);\n"))
.put(new Info("caffe::Net<double>::layer_by_name").javaText(
"public DoubleLayer layer_by_name(BytePointer layer_name) { return layer_by_name(DoubleLayer.class, layer_name); }\n"
+ "public DoubleLayer layer_by_name(String layer_name) { return layer_by_name(DoubleLayer.class, layer_name); };\n"
+ "public native @Const @Cast({\"\", \"boost::shared_ptr<caffe::Layer<double> >\"}) @SharedPtr @ByVal <L extends DoubleLayer> L layer_by_name(Class<L> cls, @StdString BytePointer layer_name);\n"
+ "public native @Const @Cast({\"\", \"boost::shared_ptr<caffe::Layer<double> >\"}) @SharedPtr @ByVal <L extends DoubleLayer> L layer_by_name(Class<L> cls, @StdString String layer_name);\n"));
}
}

0 comments on commit 5f7d393

Please sign in to comment.