1from common_place
import *
3from caffe2.python
import workspace
6def run_caffe2(init_net, predict_net, input_path, output_path=''):
8 with open(init_net,
'rb')
as f:
11 with open(predict_net,
'rb')
as f:
12 predict_net = f.read()
13 p = workspace.Predictor(init_net, predict_net)
15 results = p.run({
'data': x})
20if __name__ ==
'__main__':
23 run_caffe2(args.model[0], args.model[1], args.input, args.output_path)
save_result(output_path, output_data)
run_caffe2(init_net, predict_net, input_path, output_path='')