Skip to content

Commit

Permalink
new tip
Browse files Browse the repository at this point in the history
  • Loading branch information
bbelderbos committed Jul 2, 2024
1 parent 20246dd commit c9cddb3
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ This file gets generated by [this script](index.py).

## Marvinai

- [Image classification with marvin ai](notes/20240702100735.md)
- [Using marvin ai to extract geo locations](notes/20240628165703.md)

## Matchcase
Expand Down
44 changes: 44 additions & 0 deletions notes/20240702100735.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Image classification with Marvin AI

Another cool thing you can do with Marvin AI is classifying images. 💡 💪

I just gave it my profile picture and asked what type of programmer I am and what I am holding in my hands. 🐍🪄

See below - it did a great job! 😍 📈

```
import marvin
img = marvin.Image(
"https://pbs.twimg.com/profile_images/1365563799571431428/wj7Hu5-6_400x400.jpg"
)
programer = marvin.classify(
img,
labels=["Rustacean", "Pythonista", "Javaist", "Rubyist", "Gopher", "Haskellites"],
)
object_in_hands = marvin.classify(
img,
labels=[
"stick",
"tool",
"flag",
"banner",
"staff",
"book",
"smartphone",
"bottle",
"pen",
"notebook",
"other",
],
instructions="What object is the programmer holding?",
)
print(f"Programmer is a {programer} and is holding a {object_in_hands}")
# Outputs:
# Programmer is a Pythonista and is holding a staff
```

#marvinai

0 comments on commit c9cddb3

Please sign in to comment.