You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ImageTest.cs 721 B

123456789101112131415161718192021222324252627282930
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using System.Text;
  6. using Tensorflow;
  7. using static Tensorflow.Binding;
  8. namespace TensorFlowNET.UnitTest
  9. {
  10. [TestClass]
  11. public class ImageTest
  12. {
  13. string imgPath = "../../../../../data/shasta-daisy.jpg";
  14. Tensor contents;
  15. public ImageTest()
  16. {
  17. imgPath = Path.GetFullPath(imgPath);
  18. contents = tf.read_file(imgPath);
  19. }
  20. [TestMethod]
  21. public void decode_image()
  22. {
  23. var img = tf.image.decode_image(contents);
  24. Assert.AreEqual(img.name, "decode_image/cond_jpeg/Merge:0");
  25. }
  26. }
  27. }