-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix DeepLabV3 models * Remove some magic from handling categories files * Flatten the structure of the model directory
- Loading branch information
1 parent
553b021
commit c1f811c
Showing
25 changed files
with
1,192 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
models/**/*.onnx filter=lfs diff=lfs merge=lfs -text | ||
models/deeplab_v3_mobilenetv3_segmentation.onnx filter=lfs diff=lfs merge=lfs -text | ||
models/fasterrcnn_resnet50_fpn_detector.onnx filter=lfs diff=lfs merge=lfs -text | ||
models/mobilenetv3small-classifier.onnx filter=lfs diff=lfs merge=lfs -text | ||
models/ssdlite320_mobilenetv3_detector.onnx filter=lfs diff=lfs merge=lfs -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
import Config | ||
|
||
config :ex_vision, cache_path: "models" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
defmodule ExVision.Model.Definition.Parts.WithCategories do | ||
@moduledoc false | ||
require Logger | ||
alias ExVision.{Cache, Utils} | ||
|
||
defp get_categories(file) do | ||
file | ||
|> Cache.lazy_get() | ||
|> case do | ||
{:ok, file} -> | ||
Utils.load_categories(file) | ||
|
||
error -> | ||
Logger.error("Failed to load categories from #{file} due to #{inspect(error)}") | ||
raise "Failed to load categories from #{file}" | ||
end | ||
end | ||
|
||
defmacro __using__(options) do | ||
options = Keyword.validate!(options, [:name, :categories]) | ||
categories = options |> Keyword.fetch!(:categories) |> get_categories() | ||
spec = categories |> Enum.uniq() |> Bunch.Typespec.enum_to_alternative() | ||
|
||
quote do | ||
require Bunch.Typespec | ||
|
||
@typedoc """ | ||
Type describing all categories recognised by #{unquote(options[:name])} | ||
""" | ||
@type category_t() :: unquote(spec) | ||
|
||
@doc """ | ||
Returns a list of all categories recognised by #{unquote(options[:name])} | ||
""" | ||
@spec categories() :: [category_t()] | ||
def categories(), do: unquote(categories) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.