-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
73 lines (54 loc) · 1.85 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# kuzco <img src="man/figures/logo.png" align="right" height="108" alt="" />
<!-- badges: start -->
<!-- badges: end -->
{kuzco} is a simple vision boilerplate built for ollama in R, on top of {ollamar}. {kuzco} is designed as a computer vision assistant, giving local models guidance on classifying images and return structured data. The goal is to standardize outputs for image classification and use LLMs as an alternative option to keras or torch. ({elmer} support TBD)
## Installation
You can install the development version of kuzco like so:
``` r
devtools::install_github("frankiethull/kuzco")
```
## Example
This is a basic example which shows you how to use kuzco.
```{r example, warning=FALSE, message=FALSE}
library(kuzco)
library(ollamar)
```
here we have an image and want to learn about it:
```{r}
test_img <- file.path(system.file(package = "kuzco"), "img/test_img.jpg")
```
![picture of puppy odin circa 2019.](https://raw.githubusercontent.com/frankiethull/kuzco/refs/heads/main/inst/img/test_img.jpg)
### llm for image classification:
```{r}
llm_results <- llm_image_classification(llm_model = "llava-phi3", image = test_img)
```
```{r}
llm_results |> tibble::as_tibble()
```
```{r}
llm_results |> str()
```
### llm for image sentiment:
```{r}
llm_emotion <- llm_image_sentiment(llm_model = "llava-phi3", image = test_img)
llm_emotion |> str()
```
### llm for image recognition:
```{r}
llm_detection <- llm_image_recognition(llm_model = "llava-phi3",
image = test_img,
recognize_object = "nose")
llm_detection |> str()
```