Skip to content
Permalink
Browse files

Add support for the emotions_ferplus model in glow. (#2713)

Description
Now that we have support for auto_pad == SAME_UPPPER in glow, this model works as-is.
Sample pictures taken from the demo github repo (see README in the EmotionSampleImages folder).

Testing

ninja all
./tests/images/run.sh

Issues
Resolves #2504
  • Loading branch information...
arunm-git committed Apr 13, 2019
1 parent 372076f commit b372229110960777e1a5e5b665a244d6da31d78b
@@ -21,3 +21,8 @@ file(GLOB files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} other/*.png)
foreach(filename ${files})
configure_file(${filename} ${CMAKE_CURRENT_BINARY_DIR}/${filename} COPYONLY)
endforeach(filename)

file(GLOB files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} EmotionSampleImages/*.png)
foreach(filename ${files})
configure_file(${filename} ${CMAKE_CURRENT_BINARY_DIR}/${filename} COPYONLY)
endforeach(filename)
@@ -0,0 +1,6 @@
Images taken from https://github.com/Microsoft/onnxjs-demo/tree/master/src/assets/EmotionSampleImages
and converted to png using imagemagick:
for i in *.jpg
do
convert $i -resize 64x64\! -colorspace gray ${i%.jpg}.png
done
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -20,6 +20,7 @@ googlenetV1IdxArray=(281 222 340)
googlenetV4IdxArray=(281 207 340)
mnistIdxValues="0,1,2,3,4,5,6,7,8,9"
mnistIdxArray=(0 1 2 3 4 5 6 7 8 9)
ferplusIdxArray=(4 4 6 1 0 0 3 3 2 2)

# Accumulate errors
num_errors=0
@@ -143,6 +144,13 @@ done
./bin/image-classifier tests/images/imagenet/*.png -expected-labels=${imagenetIdxValues} -image-mode=0to1 -m=quant_resnet50 -model-input-name=gpu_0/data_0 -use-imagenet-normalization "$@"
num_errors=$(($num_errors + $?))

# Emotion_ferplus onnx model test
i=0
for png_filename in tests/images/EmotionSampleImages/*.png; do
./bin/image-classifier "$png_filename" -use-imagenet-normalization -expected-labels=${ferplusIdxArray[$i]} -image-mode=0to255 -m=emotion_ferplus/model.onnx -model-input-name=Input3 -compute-softmax "$@"
i=$(($i + 1))
done

if [ $num_errors -gt 0 ]
then
exit 1
@@ -35,3 +35,6 @@ for modelname in googlenet_v1_slim googlenet_v4_slim resnet50_tf; do
wget -nc -P $modelname \
http://fb-glow-assets.s3.amazonaws.com/models/$modelname.onnx
done

wget -nc https://onnxzoo.blob.core.windows.net/models/opset_8/emotion_ferplus/emotion_ferplus.tar.gz
tar -xzvf emotion_ferplus.tar.gz emotion_ferplus/model.onnx

0 comments on commit b372229

Please sign in to comment.
You can’t perform that action at this time.