DIGITS icon indicating copy to clipboard operation
DIGITS copied to clipboard

Does not match the DeployModel between DIGITSClassify result

Open shinfo001 opened this issue 10 years ago • 7 comments

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.

shinfo001 avatar Apr 06 '16 02:04 shinfo001

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)

shinfo001 avatar Apr 06 '16 02:04 shinfo001

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

gheinrich avatar Apr 06 '16 03:04 gheinrich

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.

shinfo001 avatar Apr 07 '16 00:04 shinfo001

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.

gheinrich avatar Apr 07 '16 03:04 gheinrich

Hi @shinfo001 does that answer your question?

gheinrich avatar Apr 15 '16 12:04 gheinrich

No response, closing.

gheinrich avatar Apr 17 '16 08:04 gheinrich

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.

shinfo001 avatar Apr 18 '16 23:04 shinfo001