From 375ffb6f99640333e9b15e44f248c2ce87de369d Mon Sep 17 00:00:00 2001 From: jakmro Date: Thu, 20 Jun 2024 18:52:07 +0200 Subject: [PATCH] Improve code readability --- lib/ex_vision/classification/generic_classifier.ex | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/ex_vision/classification/generic_classifier.ex b/lib/ex_vision/classification/generic_classifier.ex index 64b8b0a..5e7b9d1 100644 --- a/lib/ex_vision/classification/generic_classifier.ex +++ b/lib/ex_vision/classification/generic_classifier.ex @@ -1,6 +1,16 @@ defmodule ExVision.Classification.GenericClassifier do + @moduledoc false + + # Contains a default implementation of post processing for TorchVision classifiers + # To use: `use ExVision.Classification.GenericClassifier` + alias ExVision.Utils + alias ExVision.Types.ImageMetadata + + @typep output_t() :: %{atom() => number()} + + @spec postprocessing(map(), ImageMetadata.t(), [atom()]) :: output_t() def postprocessing(%{"output" => scores}, _metadata, categories) do scores |> Nx.backend_transfer()