caffe2go

command module
v0.0.0-...-64cb8c3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2018 License: BSD-2-Clause Imports: 15 Imported by: 0

README

Caffe2Go

Caffe2Go evaluate caffemodel with Golang

Usage

Command line interface

./caffe2go -i images/plane.jpg -m models/nin\_imagenet.caffemodel -l labels/synset\_words.txt -s 224 -mf means.txt

Options

age of ./caffe2go:
-cpuProf string
Filename for CPU profiling.
-i string
Path for image.
-l string
Path for labels.
-m string
Path for caffemodel.
-memProf string
Filename for Memory profiling.
-mf string
Meanfile path
-s uint
Input Shape

Use the library on your own software

package main

import (
	"fmt"
	_ "image/jpeg"
	_ "image/png"

	"github.com/Rompei/caffe2go/c2g"
)

func main() {
	caffe2go, err := c2g.NewCaffe2Go("lenet.caffemodel")
	if err != nil {
		panic(err)
	}
	output, err := caffe2go.Predict("mnist_zero.png", 28, nil)
	if err != nil {
		panic(err)
	}

	for i := range output {
		fmt.Printf("%d: %f\n", i, output[i][0][0])
	}
}

Supported layers

Now supports the layers below

Convolution
Pooling
ReLU
FullyConnected
Dropout
Softmax
LRN

License

BSD-2

Directories

Path Synopsis
Package caffe is a generated protocol buffer package.
Package caffe is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL