* limitations under the License.
*/
+#include <fstream>
#include <iostream>
#include <algorithm>
#include <string.h>
#include "ImageHelper.h"
#include "mv_selfie_segmentation_internal.h"
+#define GROUND_TRUTH TEST_RES_PATH "/res/inference/images/faceSegmentationGT.bin"
#define IMG_FACE TEST_RES_PATH "/res/inference/images/faceDetection.jpg"
using namespace testing;
ret = mv_selfie_segmentation_get_result(handle, &width, &height, &pixel_size, &data);
ASSERT_EQ(ret, 0);
- cout << "width = " << width << " height = " << height << " pixel size = " << pixel_size << endl;
+ streamsize length = static_cast<uintmax_t>(width * height * pixel_size);
+ ifstream fin(GROUND_TRUTH, ios::binary);
+ vector<char> buf(length);
- // TODO. update how to verify the data.
+ fin.read(buf.data(), length);
+ ASSERT_TRUE(fin);
+ ASSERT_TRUE(memcmp(data, buf.data(), width * height * pixel_size) == 0);
ret = mv_selfie_segmentation_destroy(handle);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
ret = mv_destroy_source(mv_source);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
-}
\ No newline at end of file
+}