How convert the file mean.binaryproto of caffe to model_meanfile.ppm of Deepstream.
NO1.Why use it to generate ppm files?
z=np.array([124, 117, 104])
NO2.The ppm file, I exported through the following code,does not work properly.
import os import numpy as np import matplotlib.pyplot as plt import caffe from PIL import Image mean_filename='./mean.binaryproto' proto_data = open(mean_filename, "rb").read() a = caffe.io.caffe_pb2.BlobProto.FromString(proto_data) mean = caffe.io.blobproto_to_array(a) mean = np.reshape(mean, (256, 256, 3)) Image.fromarray(np.array(mean, dtype=np.uint8)).save('test.ppm')
I think your question is the same as https://devtalk.nvidia.com/default/topic/1066915/deepstream-sdk/regarding-the-mean-file-used-in-deepstream-/post/5403700/#5403700 ,
please refer to https://devtalk.nvidia.com/default/topic/1066915/deepstream-sdk/regarding-the-mean-file-used-in-deepstream-/post/5404367/#5404367
Any more question, you can ask Chris in that topic.