Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Słuszniak authored and Mateusz Słuszniak committed Jul 8, 2024
1 parent b04e8f4 commit 02d4437
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ ExVision models are powered by [Ortex](https://www.github.com/elixir-nx/ortex).
In order to use the model, you need to first load it

```elixir
alias ExVision.Classification.MobileNetV3
alias ExVision.Classification.MobileNetV3Small

model = MobileNetV3.load() #=> %MobileNetV3{}
model = MobileNetV3Small.load() #=> %MobileNetV3{}
```

After that, the model is available for inference.
ExVision will take care of all necessary input transformations and covert output to a format that makes sense.

```elixir
MobileNetV3.run(model, "example/files/cat.jpg") #=> %{cat: 0.98, dog: 0.01, car: 0.00, ...}
MobileNetV3Small.run(model, "example/files/cat.jpg") #=> %{cat: 0.98, dog: 0.01, car: 0.00, ...}
```

ExVision is also capable of accepting tensors and images on input:

```elixir
cat = Image.open!("example/files/cat.jpg")
{:ok, cat_tensor} = Image.to_nx(cat)
MobileNetV3.run(model, cat) #=> %{cat: 0.98, dog: 0.01, car: 0.00, ...}
MobileNetV3.run(model, cat_tensor) #=> %{cat: 0.98, dog: 0.01, car: 0.00, ...}
MobileNetV3Small.run(model, cat) #=> %{cat: 0.98, dog: 0.01, car: 0.00, ...}
MobileNetV3Small.run(model, cat_tensor) #=> %{cat: 0.98, dog: 0.01, car: 0.00, ...}
```

### Usage in process workflow
Expand All @@ -56,7 +56,7 @@ or start it under the supervision tree
After starting, it's immediatelly available for inference using `batched_run/2` function.

```elixir
MobileNetV3.batched_run(MyModel, cat) #=> %{cat: 0.98, dog: 0.01, car: 0.00, ...}
MobileNetV3Small.batched_run(MyModel, cat) #=> %{cat: 0.98, dog: 0.01, car: 0.00, ...}
```

## Installation
Expand Down

0 comments on commit 02d4437

Please sign in to comment.