Does not match the DeployModel between DIGITSClassify result
The results of "DigitsClassfyOne" DigitsDownloadModel with "DIGITS/examples/classification/example.py" It does not match the results.
AlexNet 256 * 256 color, testdata 256 * 256 color (no resize no clip)
Whether classify of DIGITS there is a difference in the work and example.py? How can I match.
this is code
Issuing the following code is better result than example.py. But it does not fit yet
#nvidia mean make
blob = caffe_pb2.BlobProto()
with open(meanfname,'rb') as f:
blob.MergeFromString(f.read())
if blob.HasField('shape'):
blob_dims = blob.shape
assert len(blob_dims) == 4, 'Shape should have 4 dimensions - shape is "%s"' % blob.shape
elif blob.HasField('num') and blob.HasField('channels') and
blob.HasField('height') and blob.HasField('width'):
blob_dims = (blob.num, blob.channels, blob.height, blob.width)
else:
raise ValueError('blob does not provide shape or 4d dimensions')
mean_array = np.reshape(blob.data, blob_dims[1:]).mean(1).mean(1)
classifier = caffe.Classifier( prototxtfname, modelfname, image_dims=[256,256], mean=mean_array, raw_scale=255, )
image = caffe.io.load_image(imputfilename) predictions = classifier.predict([image], oversample=False)
Hello, if you want to match exactly what DIGITS is doing during inference, have a look at the script in /tools/inference.py.
On Tue, Apr 5, 2016 at 7:44 PM, shinfo001 [email protected] wrote:
this is code
#nvidia mean make blob = caffe_pb2.BlobProto() with open(meanfname,'rb') as f: blob.MergeFromString(f.read()) if blob.HasField('shape'): blob_dims = blob.shape assert len(blob_dims) == 4, 'Shape should have 4 dimensions - shape is "%s"' % blob.shape elif blob.HasField('num') and blob.HasField('channels') and
blob.HasField('height') and blob.HasField('width'): blob_dims = (blob.num, blob.channels, blob.height, blob.width) else: raise ValueError('blob does not provide shape or 4d dimensions') mean_array = np.reshape(blob.data, blob_dims[1:]).mean(1).mean(1)classifier = caffe.Classifier( prototxtfname, modelfname, image_dims=[256,256], mean=mean_array, raw_scale=255, )
image = caffe.io.load_image(imputfilename) predictions = classifier.predict([image], oversample=False)
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/NVIDIA/DIGITS/issues/673#issuecomment-206090434
Thanks for your comment
Classification of DIGITS lies in the next
/ Digits / model / images / classification
How to accurately deploy the results of DIGITS to fix the "examples/classification/example.py" it was not found.
I might not understand the question correctly but my suggestion is to not use examples/classification/example.py. Instead if you use /tools/inference.py and extend this to extract classifications from the raw network output then you will get exactly the same results as when you use the DIGITS Web UI to classify images.
Hi @shinfo001 does that answer your question?
No response, closing.
You gave me the answer to my question. I have the set up of the new machine, can not be tested immediately. I'm going to try to either test.
DIGITS think it a great tool. But if it is not means to accurately deploy the learning results are ready, And I think the hobby tools.
Thank you.