torchvisionlib

torchvision C++ library extensions

https://github.com/mlverse/torchvisionlib

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.1%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

torchvision C++ library extensions

Basic Info
  • Host: GitHub
  • Owner: mlverse
  • License: other
  • Language: C++
  • Default Branch: main
  • Size: 304 KB
Statistics
  • Stars: 9
  • Watchers: 3
  • Forks: 2
  • Open Issues: 1
  • Releases: 15
Created over 4 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# torchvisionlib



[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![R-CMD-check](https://github.com/mlverse/torchvisionlib/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/mlverse/torchvisionlib/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/torchvisionlib)](https://CRAN.R-project.org/package=torchvisionlib)
[![](https://cranlogs.r-pkg.org/badges/torchvisionlib)](https://cran.r-project.org/package=torchvisionlib)
[![Discord](https://img.shields.io/discord/837019024499277855?logo=discord)](https://discord.com/invite/s3D5cKhBkx)


The goal of torchvisionlib is to provide access to C++ opeartions implemented in
[torchvision](https://github.com/pytorch/vision). It provides plain R acesss to
some of those C++ operations but, most importantly it provides full support for 
JIT operators defined in [torchvision](https://github.com/pytorch/vision), allowing
us to load 'scripted' object detection and image segmentation models.

## Installation

torchvisionlib can be installed from CRAN with:

```r
install.packages("torchvisionlib")
```

You can also install the development version of torchvisionlib from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("mlverse/torchvisionlib")
```

## Example

Suppose that we want to load an image detection model implemented in torchvision.
First, in Python, we can save JIT script and then save this model:

```python
import torch
import torchvision

model = torchvision.models.detection.fasterrcnn_mobilenet_v3_large_320_fpn(pretrained=True)
model.eval()

jit_model = torch.jit.script(model)
torch.jit.save(jit_model, "fasterrcnn_mobilenet_v3_large_320_fpn.pt")
```

We can then load this model in R. Simply loading torchvisionlib will register all
JIT operators, and we can use `torch::jit_load()`.

```{r include=FALSE}
url <- "https://storage.googleapis.com/torch-lantern-builds/testing-models/fasterrcnn_mobilenet_v3_large_320_fpn.pt"
download.file(url, destfile = "fasterrcnn_mobilenet_v3_large_320_fpn.pt", mode = "wb")
```

```{r}
library(torchvisionlib)
model <- torch::jit_load("fasterrcnn_mobilenet_v3_large_320_fpn.pt")
model
```

You can then use this model to make preditions or even fine tuning.

Owner

  • Name: mlverse
  • Login: mlverse
  • Kind: organization

Open source libraries to scale Data Science

GitHub Events

Total
  • Create event: 2
  • Release event: 1
  • Issues event: 1
  • Watch event: 1
  • Push event: 40
  • Pull request event: 3
  • Fork event: 1
Last Year
  • Create event: 2
  • Release event: 1
  • Issues event: 1
  • Watch event: 1
  • Push event: 40
  • Pull request event: 3
  • Fork event: 1

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 11
  • Total pull requests: 14
  • Average time to close issues: 26 days
  • Average time to close pull requests: about 2 months
  • Total issue authors: 2
  • Total pull request authors: 3
  • Average comments per issue: 0.36
  • Average comments per pull request: 0.0
  • Merged pull requests: 13
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 4
  • Average time to close issues: N/A
  • Average time to close pull requests: 5 months
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • dfalbel (10)
  • SvenVw (1)
Pull Request Authors
  • dfalbel (12)
  • bart1 (2)
  • skeydan (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 260 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 6
  • Total maintainers: 1
cran.r-project.org: torchvisionlib

Additional Operators for Image Models

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 260 Last month
Rankings
Dependent repos count: 24.4%
Dependent packages count: 28.0%
Average: 33.7%
Downloads: 48.6%
Maintainers (1)
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • Rcpp * imports
  • glue * imports
  • rlang * imports
  • torch >= 0.8.0 imports
  • testthat >= 3.0.0 suggests
.github/workflows/R-CMD-check.yaml actions
  • Jimver/cuda-toolkit v0.2.8 composite
  • actions/checkout v2 composite
  • actions/download-artifact v3 composite
  • actions/upload-artifact main composite
  • actions/upload-artifact v3 composite
  • jwlawson/actions-setup-cmake v1 composite
  • mlverse/torch/.github/actions/install-cudnn main composite
  • mlverse/torch/.github/actions/setup-r main composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v2 composite
  • svenstaro/upload-release-action v2 composite