diff --git a/test/high_level_image_classification_test.exs b/test/high_level_image_classification_test.exs index e904dc3..810bdf0 100644 --- a/test/high_level_image_classification_test.exs +++ b/test/high_level_image_classification_test.exs @@ -8,30 +8,30 @@ defmodule TFLiteElixir.ImageClassification.Test do input_path = Path.join([__DIR__, "test_data", "parrot.jpeg"]) {:ok, pid} = ImageClassification.start(filename) - %{class_id: 923, score: 0.70703125} = ImageClassification.predict(pid, input_path) + %{class_id: 923, score: _score} = ImageClassification.predict(pid, input_path) - %{class_id: 923, score: 0.70703125} = + %{class_id: 923, score: _score} = ImageClassification.predict(pid, StbImage.read_file!(input_path)) - %{class_id: 923, score: 0.70703125} = + %{class_id: 923, score: _score} = ImageClassification.predict(pid, StbImage.to_nx(StbImage.read_file!(input_path))) assert :ok == ImageClassification.set_label_from_associated_file(pid, "inat_bird_labels.txt") - %{class_id: 923, label: "Ara macao (Scarlet Macaw)", score: 0.70703125} = + %{class_id: 923, label: "Ara macao (Scarlet Macaw)", score: _score} = ImageClassification.predict(pid, input_path) [ - %{class_id: 923, label: "Ara macao (Scarlet Macaw)", score: 0.70703125}, + %{class_id: 923, label: "Ara macao (Scarlet Macaw)", score: _score1}, %{ class_id: 837, label: "Platycercus elegans (Crimson Rosella)", - score: 0.078125 + score: _score2 }, %{ class_id: 245, label: "Coracias caudatus (Lilac-breasted Roller)", - score: 0.01953125 + score: _score3 } ] = ImageClassification.predict(pid, input_path, top_k: 3) end diff --git a/test/interpreter_test.exs b/test/interpreter_test.exs index ab34e25..25b4c0d 100644 --- a/test/interpreter_test.exs +++ b/test/interpreter_test.exs @@ -90,7 +90,7 @@ defmodule TFLiteElixir.Interpreter.Test do filename = Path.join([__DIR__, "test_data", "mobilenet_v2_1.0_224_inat_bird_quant.tflite"]) interpreter = Interpreter.new!(filename) - assert 65 == Interpreter.nodes_size(interpreter) + assert 67 == Interpreter.nodes_size(interpreter) end test "nodes_size/1 with invalid interpreter" do @@ -102,7 +102,7 @@ defmodule TFLiteElixir.Interpreter.Test do filename = Path.join([__DIR__, "test_data", "mobilenet_v2_1.0_224_inat_bird_quant.tflite"]) interpreter = Interpreter.new!(filename) - assert Enum.to_list(0..64) == Interpreter.execution_plan(interpreter) + assert [65, 62, 66, 64] == Interpreter.execution_plan(interpreter) end test "execution_plan/1 with invalid interpreter" do diff --git a/test/test_data/parrot-expected-out.bin b/test/test_data/parrot-expected-out.bin index d53ebde..b103da2 100644 Binary files a/test/test_data/parrot-expected-out.bin and b/test/test_data/parrot-expected-out.bin differ diff --git a/test/tflite_task_classify_image_test.exs b/test/tflite_task_classify_image_test.exs index cb8918b..24e172e 100644 --- a/test/tflite_task_classify_image_test.exs +++ b/test/tflite_task_classify_image_test.exs @@ -24,8 +24,8 @@ defmodule TFLiteElixir.Test.ClassifyImage do """ -------RESULTS-------- - Ara macao (Scarlet Macaw): 0.70703 - Platycercus elegans (Crimson Rosella): 0.07813 + Ara macao (Scarlet Macaw): 0.73828 + Platycercus elegans (Crimson Rosella): 0.06641 Coracias caudatus (Lilac-breasted Roller): 0.01953 """ = String.split(output, "\n") diff --git a/test/tflite_task_detect_image_test.exs b/test/tflite_task_detect_image_test.exs index ac3aaf6..dd26f8a 100644 --- a/test/tflite_task_detect_image_test.exs +++ b/test/tflite_task_detect_image_test.exs @@ -22,7 +22,7 @@ defmodule TFLiteElixir.Test.DetectImage do """ cat id : 16 - score: 0.953 + score: 0.934 bbox : [3, -1, 294, 240] """ = String.split(output, "\n")