Skip to content

Commit

Permalink
Improve code readability
Browse files Browse the repository at this point in the history
  • Loading branch information
jakmro committed Jun 20, 2024
1 parent df4ff4b commit 375ffb6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/ex_vision/classification/generic_classifier.ex
Original file line number Diff line number Diff line change
@@ -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()
Expand Down

0 comments on commit 375ffb6

Please sign in to comment.