A problem about mean-file

How convert the file mean.binaryproto of caffe to model_meanfile.ppm of Deepstream.

Please refer to
https://devtalk.nvidia.com/default/topic/1066579/deepstream-sdk/how-to-generate-the-mean-file-for-classifier-which-is-used-by-deepstream-/post/5402720/#5402720

and

https://devtalk.nvidia.com/default/topic/1066915/regarding-the-mean-file-used-in-deepstream-/?offset=1

Hi Morganh

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)[0]

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.