├── docs ├── .nojekyll ├── getting-started │ ├── adding-task.md │ ├── adding-model.md │ ├── intro-libtorch.md │ └── setup-guidelines.md ├── assets │ ├── flow.jpg │ ├── icon.png │ ├── banner.png │ ├── favicon.ico │ ├── app_screen.png │ ├── docs_banner.png │ ├── pytorch_logo.png │ └── ic_launcher-playstore.png ├── contributing.md ├── about │ ├── examples.md │ ├── architecture.md │ └── models.md ├── _sidebar.md ├── changelog.md ├── contributing │ └── pr-checklist.md ├── README.md ├── index.html └── privacy.html ├── app ├── .gitignore ├── src │ ├── main │ │ ├── ic_launcher-playstore.png │ │ ├── res │ │ │ ├── drawable-v24 │ │ │ │ ├── banner.png │ │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── preloaded_fonts.xml │ │ │ │ ├── styles.xml │ │ │ │ ├── strings.xml │ │ │ │ └── font_certs.xml │ │ │ ├── font │ │ │ │ ├── work_sans.xml │ │ │ │ └── work_sans_thin.xml │ │ │ ├── menu │ │ │ │ └── options_menu.xml │ │ │ ├── layout │ │ │ │ ├── main_fragment.xml │ │ │ │ ├── main_activity.xml │ │ │ │ └── about_fragment.xml │ │ │ └── navigation │ │ │ │ └── nav_graph.xml │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── prabhuomkar │ │ │ │ └── torchexpo │ │ │ │ ├── Constants.kt │ │ │ │ ├── ui │ │ │ │ ├── main │ │ │ │ │ ├── MainViewModel.kt │ │ │ │ │ └── MainFragment.kt │ │ │ │ └── about │ │ │ │ │ ├── AboutViewModel.kt │ │ │ │ │ └── AboutFragment.kt │ │ │ │ ├── data │ │ │ │ └── models │ │ │ │ │ ├── Model.kt │ │ │ │ │ └── Task.kt │ │ │ │ └── MainActivity.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── prabhuomkar │ │ │ └── torchexpo │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── io │ │ └── github │ │ └── prabhuomkar │ │ └── torchexpo │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle ├── models ├── requirements.txt ├── image_classification.ipynb └── image_segmentation.ipynb ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── CONTRIBUTING.md ├── .travis.yml ├── package.json ├── gradle.properties ├── .gitignore ├── gradlew.bat ├── README.md ├── gradlew └── LICENSE /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /docs/getting-started/adding-task.md: -------------------------------------------------------------------------------- 1 | # Adding a ML Task -------------------------------------------------------------------------------- /docs/getting-started/adding-model.md: -------------------------------------------------------------------------------- 1 | # Adding a ML Model -------------------------------------------------------------------------------- /models/requirements.txt: -------------------------------------------------------------------------------- 1 | torch 2 | torchvision 3 | jupyter -------------------------------------------------------------------------------- /docs/getting-started/intro-libtorch.md: -------------------------------------------------------------------------------- 1 | # Introduction to LibTorch -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name='TorchExpo' 2 | include ':app' 3 | -------------------------------------------------------------------------------- /docs/assets/flow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/docs/assets/flow.jpg -------------------------------------------------------------------------------- /docs/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/docs/assets/icon.png -------------------------------------------------------------------------------- /docs/assets/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/docs/assets/banner.png -------------------------------------------------------------------------------- /docs/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/docs/assets/favicon.ico -------------------------------------------------------------------------------- /docs/assets/app_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/docs/assets/app_screen.png -------------------------------------------------------------------------------- /docs/assets/docs_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/docs/assets/docs_banner.png -------------------------------------------------------------------------------- /docs/assets/pytorch_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/docs/assets/pytorch_logo.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /docs/contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing Guide 2 | 3 | ### For Machine Learning Enthusiasts 4 | 5 | ### For Android Enthusiasts 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /docs/about/examples.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | ### Image Classification 4 | 5 | #### PyTorch Models 6 | 7 | #### Android 8 | 9 | #### FAQ -------------------------------------------------------------------------------- /docs/assets/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/docs/assets/ic_launcher-playstore.png -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guide 2 | 3 | Visit our updated [Contributing Guide](https://prabhuomkar.github.io/TorchExpo/#/contributing). -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/res/drawable-v24/banner.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kriticalflare/TorchExpo/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/java/io/github/prabhuomkar/torchexpo/Constants.kt: -------------------------------------------------------------------------------- 1 | package io.github.prabhuomkar.torchexpo 2 | 3 | const val HELP_URL = "https://github.com/prabhuomkar/TorchExpo" 4 | const val CONTACT_EMAIL = "prabhuomkar@pm.me" 5 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/prabhuomkar/torchexpo/ui/main/MainViewModel.kt: -------------------------------------------------------------------------------- 1 | package io.github.prabhuomkar.torchexpo.ui.main 2 | 3 | import androidx.lifecycle.ViewModel 4 | 5 | class MainViewModel : ViewModel() { 6 | // TODO: Implement the ViewModel 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/prabhuomkar/torchexpo/ui/about/AboutViewModel.kt: -------------------------------------------------------------------------------- 1 | package io.github.prabhuomkar.torchexpo.ui.about 2 | 3 | import androidx.lifecycle.ViewModel 4 | 5 | class AboutViewModel : ViewModel() { 6 | // TODO: Implement the ViewModel 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #212121 4 | #000000 5 | #ed4b2b 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/preloaded_fonts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @font/work_sans 5 | @font/work_sans_thin 6 | 7 | 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jun 02 23:23:21 IST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/font/work_sans.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/font/work_sans_thin.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /app/src/test/java/io/github/prabhuomkar/torchexpo/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package io.github.prabhuomkar.torchexpo 2 | 3 | import org.junit.Assert.assertEquals 4 | import org.junit.Test 5 | 6 | /** 7 | * Example local unit test, which will execute on the development machine (host). 8 | * 9 | * See [testing documentation](http://d.android.com/tools/testing). 10 | */ 11 | class ExampleUnitTest { 12 | @Test 13 | fun addition_isCorrect() { 14 | assertEquals(4, 2 + 2) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | TorchExpo 3 | Collection of machine learning experiments using PyTorch Android API 4 | v%1$s 5 | 6 | About 7 | Github 8 | Contact us 9 | 10 | Licenses 11 | 12 | Please select an email client 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/menu/options_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 12 | 16 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | jdk: oraclejdk8 3 | sudo: false 4 | os: linux 5 | android: 6 | components: 7 | - tools 8 | - platform-tools 9 | - build-tools-29.0.3 10 | - android-29 11 | - addon-google_apis-google-29 12 | - extra-google-m2repository 13 | - extra-android-m2repository 14 | before_cache: 15 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock 16 | cache: 17 | directories: 18 | - $HOME/.m2 19 | - $HOME/.gradle/caches/ 20 | - $HOME/.gradle/wrapper/ 21 | - "${TRAVIS_BUILD_DIR}/gradle/caches/" 22 | - "${TRAVIS_BUILD_DIR}/gradle/wrapper/dists/" 23 | script: 24 | - ./gradlew ktlintCheck 25 | - ./gradlew build check -------------------------------------------------------------------------------- /docs/_sidebar.md: -------------------------------------------------------------------------------- 1 | - [Home](README.md) 2 | 3 | - About TorchExpo 4 | 5 | - [Architecture](about/architecture.md) 6 | - [Models](about/models.md) 7 | - [Examples](about/examples.md) 8 | 9 | 10 | - Getting Started 11 | 12 | - [Setup & Guidelines](getting-started/setup-guidelines.md) 13 | - [Intro to LibTorch](getting-started/intro-libtorch.md) 14 | - [Adding Task](getting-started/adding-task.md) 15 | - [Adding Model](getting-started/adding-model.md) 16 | 17 | - [Contributing Guide](contributing.md) 18 | 19 | - [PR Checklist](contributing/pr-checklist.md) 20 | 21 | - [Play Store](https://rebrand.ly/torchexpo-android) 22 | 23 | - [Changelog](changelog.md) -------------------------------------------------------------------------------- /app/src/main/java/io/github/prabhuomkar/torchexpo/data/models/Model.kt: -------------------------------------------------------------------------------- 1 | package io.github.prabhuomkar.torchexpo.data.models 2 | 3 | import androidx.room.Entity 4 | import androidx.room.ForeignKey 5 | import androidx.room.ForeignKey.CASCADE 6 | import androidx.room.PrimaryKey 7 | 8 | @Entity( 9 | tableName = "models", foreignKeys = [ForeignKey( 10 | entity = Task::class, parentColumns = ["id"], childColumns = ["taskId"], 11 | onDelete = CASCADE 12 | )] 13 | ) 14 | data class Model( 15 | @PrimaryKey 16 | val id: Int, 17 | val name: String, 18 | val description: String, 19 | val paperLink: String, 20 | val sourceLink: String, 21 | val downloadLink: String, 22 | val imageLink: String, 23 | val size: Int, 24 | val taskId: Int 25 | ) 26 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "torchexpo", 3 | "version": "1.1.0", 4 | "description": "Collection of Machine Learning Experiments using PyTorch Android API", 5 | "directories": { 6 | "doc": "docs" 7 | }, 8 | "scripts": { 9 | "test": "echo \"Error: no test specified\" && exit 1" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/prabhuomkar/TorchExpo.git" 14 | }, 15 | "keywords": [ 16 | "pytorch", 17 | "android", 18 | "machine-learning", 19 | "libtorch", 20 | "python", 21 | "experiments" 22 | ], 23 | "author": "Omkar Prabhu ", 24 | "license": "Apache-2.0", 25 | "bugs": { 26 | "url": "https://github.com/prabhuomkar/TorchExpo/issues" 27 | }, 28 | "homepage": "https://github.com/prabhuomkar/TorchExpo#readme" 29 | } 30 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/io/github/prabhuomkar/torchexpo/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package io.github.prabhuomkar.torchexpo 2 | 3 | import androidx.test.ext.junit.runners.AndroidJUnit4 4 | import androidx.test.platform.app.InstrumentationRegistry 5 | import org.junit.Assert.assertEquals 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | /** 10 | * Instrumented test, which will execute on an Android device. 11 | * 12 | * See [testing documentation](http://d.android.com/tools/testing). 13 | */ 14 | @RunWith(AndroidJUnit4::class) 15 | class ExampleInstrumentedTest { 16 | @Test 17 | fun useAppContext() { 18 | // Context of the app under test. 19 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 20 | assertEquals("io.github.prabhuomkar.torchexpo", appContext.packageName) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/main_fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/changelog.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | All notable changes to this project will be documented in this file. 3 | This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) for Android application and versioning for PyTorch Models is WIP. 4 | 5 | ### Unreleased 6 | - Bug fixes for navigation across the application 7 | - Contact button opening the default email client 8 | - Image Classification task with MNIST model are at WIP Stage 9 | - Image Segmentation task with FCN & DeepLabV3 models are at WIP Stage 10 | - CHANGELOG page with version updates 11 | 12 | ### 1.0.1 _(2020-03-30)_ 13 | #### Added 14 | - PyTorch SOTA Image Classification Models _AlexNet, ResNet18, GoogleNet_ 15 | - Initial project structure with seperation of concerns between UI, Models, PyTorch Inferences 16 | - Runner & Targets for _ImageNet_ dataset 17 | 18 | #### Changed 19 | - Refactoring of artworks and application name from PyTorch Android to **TorchExpo** 20 | 21 | #### Removed 22 | - Redundant tasks without any models -------------------------------------------------------------------------------- /app/src/main/res/layout/main_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 22 | 23 | -------------------------------------------------------------------------------- /docs/about/architecture.md: -------------------------------------------------------------------------------- 1 | # Architecture 2 | 3 | ### Android 4 | 5 | #### Project Structure 6 | TODO: Android Project Directory Structure 7 | 8 | #### Release Process 9 | Android application is also released manually by maintainer currently and changelog can be found [here](https://prabhuomkar.github.io/TorchExpo/#/changelog) 10 | Reach out to [Omkar Prabhu](mailto:prabhuomkar@pm.me) if you have any queries, report any issue, etc. 11 | Feel free to send a PR for [Issue #2](https://github.com/prabhuomkar/TorchExpo/issues/2) - Automating the process of PlayStore release 12 | 13 | ### PyTorch Models 14 | * [models](models/) - Contains notebooks for generating torchscript modules. All the notebooks are specific to tasks and compiled all together during the release. 15 | Output files _(`.pt` files)_ are uploaded to Dropbox manually during the application release process. 16 | 17 | #### Release Process 18 | Models are usually not versioned, but they are released manually. 19 | Feel free to send a PR for automating the process of model creation and uploading on Dropbox. -------------------------------------------------------------------------------- /docs/contributing/pr-checklist.md: -------------------------------------------------------------------------------- 1 | # Pull Request Checklist 2 | 3 | ### Android 4 | * You have linted the code using gradle `ktlintCheck` task and used the `ktlintFormat` task to format the code according to [kotlin style guide](https://github.com/pinterest/ktlint#standard-rules). 5 | It is recommended that you install the Git pre-commit hook if you are on Linux/Mac OS to ensure all code being pushed builds and adheres to the code style guidelines. Use the Gradle `addKtlintCheckGitPreCommitHook` task to install the git pre-commit hook. 6 | * TODO: Process followed as given in Getting Started section for Task/Model 7 | * TODO: Model hosted on Dropbox and url shortener link is available 8 | * TODO: UI cross-check and build check 9 | 10 | ### PyTorch Models 11 | * Your `model` is added in the appropriate `.ipynb`. If the `.ipynb` doesn't exist, you have created a new notebook with `snake_case` naming convention. 12 | * You have tested your model output file locally and attached a `GitHub gist` or `Google Colab Notebook` link of the working demo in the PR. 13 | * You have added the entry of your model in `docs/about/models.md` under appropriate table and section. 14 | -------------------------------------------------------------------------------- /docs/getting-started/setup-guidelines.md: -------------------------------------------------------------------------------- 1 | # Setup & Guidelines 2 | 3 | ### Android Studio Setup 4 | 5 | #### Importing Project 6 | 7 | #### Building Gradle Dependencies 8 | 9 | [Read more](/contributing/pr-checklist#android) about PR Checklist for Android Application Code 10 | 11 | ### PyTorch Setup 12 | 13 | #### Virtual Environment 14 | Follow the steps to replicate the environment for generating torchscript modules locally/online. 15 | * Create a Python 3.6+ virtual environment by running `python3 -m venv torchexpo` 16 | * Activate the environment by running `source bin/torchexpo` 17 | * Change the directory to `models` and run `pip install -r requirements` to install all dependencies 18 | 19 | #### Running Conversion Scripts 20 | Currently, all conversion scripts (notebooks) are ran on CPU to avoid any device inconsistency after conversion for Android. 21 | You can spin up the jupyter notebook as its done usually and run the required cells to create the outputs in the same directory. 22 | 23 | 24 | ### Common Issues & Solutions 25 | * [Gradle Error & Its Solution]() 26 | * [PyTorch XYZ Error & Its Solution]() 27 | * [Add More Error & Its Solution]() 28 | * [Add More Error & Its Solution]() -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | # Kotlin code style for this project: "official" or "obsolete": 21 | kotlin.code.style=official 22 | -------------------------------------------------------------------------------- /app/src/main/res/navigation/nav_graph.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 20 | 21 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/prabhuomkar/torchexpo/data/models/Task.kt: -------------------------------------------------------------------------------- 1 | package io.github.prabhuomkar.torchexpo.data.models 2 | 3 | import androidx.room.Entity 4 | import androidx.room.PrimaryKey 5 | import androidx.room.TypeConverter 6 | import androidx.room.TypeConverters 7 | 8 | @Entity(tableName = "tasks") 9 | @TypeConverters(ResearchAreaTypeConverter::class) 10 | data class Task( 11 | @PrimaryKey 12 | val id: Int, 13 | val name: String, 14 | val description: String, 15 | val imageLink: String, 16 | val researchArea: ResearchArea 17 | ) 18 | 19 | enum class ResearchArea { 20 | Vision, 21 | Generative, 22 | Language, 23 | Audio, 24 | Unknown 25 | } 26 | 27 | class ResearchAreaTypeConverter { 28 | @TypeConverter 29 | fun fromResearchArea(researchArea: ResearchArea): String { 30 | return researchArea.toString() 31 | } 32 | 33 | @TypeConverter 34 | fun toResearchArea(area: String): ResearchArea { 35 | return when (area) { 36 | "Vision" -> ResearchArea.Vision 37 | "Generative" -> ResearchArea.Generative 38 | "Language" -> ResearchArea.Language 39 | "Audio" -> ResearchArea.Audio 40 | else -> ResearchArea.Unknown 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # TorchExpo 2 | Collection of Machine Learning Experiments using PyTorch Android API 3 | 4 | ## What is TorchExpo? 5 | TorchExpo is an android application which contains collection of machine learning experiments 6 | built using PyTorch and its Android API. This application will allow you to try tasks like Image 7 | Classification with State-Of-The-Art models _(like AlexNet, ResNet, etc.)_. 8 | 9 | ### Built With 10 | * [PyTorch](https://pytorch.org) 11 | * [PyTorch Android API](https://pytorch.org/mobile/android/) 12 | * [Android Ecosystem](https://developer.android.com) 13 | 14 | [Read more](/about/architecture) about the architecture of the application. 15 | 16 | ## About PyTorch Mobile 17 | PyTorch Mobile is an experiment release that provides APIs to build an end-to-end workflow 18 | from Python to deployment on iOS and Android. [Read more](https://pytorch.org/mobile/home/) 19 | 20 |

21 | 22 |

23 | 24 | ### PyTorch Android API 25 | PyTorch Mobile provides Java APIs for integration of Machine Learning models built with Python 26 | into an Android application. It is as simple as importing and using any other Android library. You 27 | can add PyTorch's Gradle dependencies and can run inferences. 28 | [Read more](https://pytorch.org/mobile/android/) 29 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/prabhuomkar/torchexpo/ui/main/MainFragment.kt: -------------------------------------------------------------------------------- 1 | package io.github.prabhuomkar.torchexpo.ui.main 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import androidx.fragment.app.Fragment 8 | import androidx.lifecycle.ViewModelProvider 9 | import io.github.prabhuomkar.torchexpo.databinding.MainFragmentBinding 10 | 11 | class MainFragment : Fragment() { 12 | 13 | companion object { 14 | fun newInstance() = MainFragment() 15 | } 16 | 17 | private lateinit var viewModel: MainViewModel 18 | private var _binding: MainFragmentBinding? = null 19 | private val binding get() = _binding!! 20 | 21 | override fun onCreateView( 22 | inflater: LayoutInflater, 23 | container: ViewGroup?, 24 | savedInstanceState: Bundle? 25 | ): View { 26 | _binding = MainFragmentBinding.inflate(inflater, container, false) 27 | return binding.root 28 | } 29 | 30 | override fun onActivityCreated(savedInstanceState: Bundle?) { 31 | super.onActivityCreated(savedInstanceState) 32 | viewModel = ViewModelProvider(this).get(MainViewModel::class.java) 33 | // TODO: Use the ViewModel 34 | } 35 | 36 | override fun onDestroyView() { 37 | super.onDestroyView() 38 | _binding = null 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /docs/about/models.md: -------------------------------------------------------------------------------- 1 | # Models 2 | 3 | ### Computer Vision 4 | | Task | Model Name | Model Download Link | 5 | | ---- | ---------- | ------------------- | 6 | | Image Classification | ResNet-18 | [https://rebrand.ly/torchexpo-resnet-18](https://rebrand.ly/torchexpo-resnet-18) | 7 | | Image Classification | AlexNet | [https://rebrand.ly/torchexpo-alexnet](https://rebrand.ly/torchexpo-alexnet) | 8 | | Image Classification | GoogleNet | [https://rebrand.ly/torchexpo-googlenet](https://rebrand.ly/torchexpo-googlenet) | 9 | | Image Segmentation | DeepLabV3-ResNet101 | [https://rebrand.ly/torchexpo-deeplabv3-resnet101](https://rebrand.ly/torchexpo-deeplabv3-resnet101) | 10 | | Image Segmentation | FCN-ResNet101 | [https://rebrand.ly/torchexpo-fcn-resnet101](https://rebrand.ly/torchexpo-fcn-resnet101) | 11 | 12 | ### Natural Language Processing 13 | | Task | Model Name | Model Download Link | 14 | | ---- | ---------- | ------------------- | 15 | 16 | ### Medical 17 | | Task | Model Name | Model Download Link | 18 | | ---- | ---------- | ------------------- | 19 | 20 | ### Speech 21 | | Task | Model Name | Model Download Link | 22 | | ---- | ---------- | ------------------- | 23 | 24 | ### Audio 25 | | Task | Model Name | Model Download Link | 26 | | ---- | ---------- | ------------------- | 27 | 28 | ### Adversarial 29 | | Task | Model Name | Model Download Link | 30 | | ---- | ---------- | ------------------- | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | TorchExpo 15 | 16 | 17 | 18 | 31 | 32 | 33 |
34 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/prabhuomkar/torchexpo/ui/about/AboutFragment.kt: -------------------------------------------------------------------------------- 1 | package io.github.prabhuomkar.torchexpo.ui.about 2 | 3 | import android.content.Intent 4 | import android.os.Bundle 5 | import android.view.LayoutInflater 6 | import android.view.View 7 | import android.view.ViewGroup 8 | import androidx.fragment.app.Fragment 9 | import androidx.lifecycle.ViewModelProvider 10 | import com.google.android.gms.oss.licenses.OssLicensesMenuActivity 11 | import io.github.prabhuomkar.torchexpo.BuildConfig 12 | import io.github.prabhuomkar.torchexpo.R 13 | import io.github.prabhuomkar.torchexpo.databinding.AboutFragmentBinding 14 | 15 | class AboutFragment : Fragment() { 16 | 17 | companion object { 18 | fun newInstance() = 19 | AboutFragment() 20 | } 21 | 22 | private lateinit var viewModel: AboutViewModel 23 | private var _binding: AboutFragmentBinding? = null 24 | private val binding get() = _binding!! 25 | 26 | override fun onCreateView( 27 | inflater: LayoutInflater, 28 | container: ViewGroup?, 29 | savedInstanceState: Bundle? 30 | ): View? { 31 | _binding = AboutFragmentBinding.inflate(inflater, container, false) 32 | return binding.root 33 | } 34 | 35 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { 36 | super.onViewCreated(view, savedInstanceState) 37 | binding.versionTextView.text = 38 | requireContext().getString(R.string.app_version, BuildConfig.VERSION_NAME) 39 | binding.licensesTextView.setOnClickListener { _ -> 40 | startActivity( 41 | Intent( 42 | activity, 43 | OssLicensesMenuActivity::class.java 44 | ) 45 | ) 46 | } 47 | } 48 | 49 | override fun onActivityCreated(savedInstanceState: Bundle?) { 50 | super.onActivityCreated(savedInstanceState) 51 | viewModel = ViewModelProvider(this).get(AboutViewModel::class.java) 52 | // TODO: Use the ViewModel 53 | } 54 | 55 | override fun onDestroyView() { 56 | super.onDestroyView() 57 | _binding = null 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/res/layout/about_fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 20 | 21 | 32 | 33 | 42 | 43 | 53 | 54 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.aar 4 | *.ap_ 5 | *.aab 6 | 7 | # Files for the ART/Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | out/ 17 | # Uncomment the following line in case you need and you don't have the release build type files in your app 18 | # release/ 19 | 20 | # Gradle files 21 | .gradle/ 22 | build/ 23 | 24 | # Local configuration file (sdk path, etc) 25 | local.properties 26 | 27 | # Proguard folder generated by Eclipse 28 | proguard/ 29 | 30 | # Log Files 31 | *.log 32 | 33 | # Android Studio Navigation editor temp files 34 | .navigation/ 35 | 36 | # Android Studio captures folder 37 | captures/ 38 | 39 | # IntelliJ 40 | *.iml 41 | .idea/ 42 | .idea/workspace.xml 43 | .idea/tasks.xml 44 | .idea/gradle.xml 45 | .idea/assetWizardSettings.xml 46 | .idea/dictionaries 47 | .idea/libraries 48 | # Android Studio 3 in .gitignore file. 49 | .idea/caches 50 | .idea/modules.xml 51 | # Comment next line if keeping position of elements in Navigation Editor is relevant for you 52 | .idea/navEditor.xml 53 | 54 | # Keystore files 55 | # Uncomment the following lines if you do not want to check your keystore files in. 56 | #*.jks 57 | #*.keystore 58 | 59 | # External native build folder generated in Android Studio 2.2 and later 60 | .externalNativeBuild 61 | .cxx/ 62 | 63 | # Google Services (e.g. APIs or Firebase) 64 | # google-services.json 65 | 66 | # Freeline 67 | freeline.py 68 | freeline/ 69 | freeline_project_description.json 70 | 71 | # fastlane 72 | fastlane/report.xml 73 | fastlane/Preview.html 74 | fastlane/screenshots 75 | fastlane/test_output 76 | fastlane/readme.md 77 | 78 | # Version control 79 | vcs.xml 80 | 81 | # lint 82 | lint/intermediates/ 83 | lint/generated/ 84 | lint/outputs/ 85 | lint/tmp/ 86 | lint/reports/ 87 | 88 | # Python 89 | __pycache__/ 90 | *.py[cod] 91 | *$py.class 92 | *.so 93 | .Python 94 | build/ 95 | develop-eggs/ 96 | dist/ 97 | downloads/ 98 | eggs/ 99 | .eggs/ 100 | lib/ 101 | lib64/ 102 | parts/ 103 | sdist/ 104 | var/ 105 | wheels/ 106 | pip-wheel-metadata/ 107 | share/python-wheels/ 108 | *.egg-info/ 109 | .installed.cfg 110 | *.egg 111 | MANIFEST 112 | *.manifest 113 | *.spec 114 | pip-log.txt 115 | pip-delete-this-directory.txt 116 | .ipynb_checkpoints 117 | profile_default/ 118 | ipython_config.py 119 | __pypackages__/ 120 | .env 121 | .venv 122 | env/ 123 | venv/ 124 | ENV/ 125 | env.bak/ 126 | venv.bak/ 127 | 128 | # System 129 | .DS_Store 130 | *.pt 131 | .vscode -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'com.google.android.gms.oss-licenses-plugin' 3 | apply plugin: 'kotlin-android' 4 | apply plugin: 'kotlin-android-extensions' 5 | apply plugin: 'kotlin-kapt' 6 | apply plugin: 'androidx.navigation.safeargs' 7 | 8 | android { 9 | compileSdkVersion 29 10 | buildToolsVersion "29.0.3" 11 | defaultConfig { 12 | applicationId "io.github.prabhuomkar.torchexpo" 13 | minSdkVersion 23 14 | targetSdkVersion 29 15 | versionCode 1 16 | versionName "1.1.0-alpha" 17 | 18 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 19 | } 20 | buildTypes { 21 | release { 22 | minifyEnabled false 23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 24 | } 25 | } 26 | buildFeatures { 27 | viewBinding = true 28 | } 29 | compileOptions { 30 | sourceCompatibility = JavaVersion.VERSION_1_8 31 | targetCompatibility = JavaVersion.VERSION_1_8 32 | } 33 | kotlinOptions { 34 | jvmTarget = JavaVersion.VERSION_1_8 35 | } 36 | } 37 | 38 | dependencies { 39 | implementation fileTree(dir: 'libs', include: ['*.jar']) 40 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 41 | implementation "androidx.appcompat:appcompat:$appcompat_version" 42 | implementation "androidx.core:core-ktx:$core_ktx_version" 43 | implementation "androidx.constraintlayout:constraintlayout:$constraint_version" 44 | implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version" 45 | implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" 46 | implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" 47 | implementation "androidx.navigation:navigation-ui-ktx:$nav_version" 48 | implementation "androidx.navigation:navigation-dynamic-features-fragment:$nav_version" 49 | implementation "com.google.android.material:material:$mat_comp_version" 50 | implementation "androidx.legacy:legacy-support-v4:$legacy_version" 51 | implementation "com.google.android.gms:play-services-oss-licenses:$oss_version" 52 | implementation "androidx.room:room-runtime:$room_version" 53 | implementation "androidx.room:room-ktx:$room_version" 54 | implementation "androidx.room:room-ktx:$room_version" 55 | testImplementation 'junit:junit:4.12' 56 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 57 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 58 | androidTestImplementation "androidx.navigation:navigation-testing:$nav_version" 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/prabhuomkar/torchexpo/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package io.github.prabhuomkar.torchexpo 2 | 3 | import android.content.ActivityNotFoundException 4 | import android.content.Intent 5 | import android.net.Uri 6 | import android.os.Bundle 7 | import android.view.Menu 8 | import android.view.MenuInflater 9 | import android.view.MenuItem 10 | import android.widget.Toast 11 | import androidx.appcompat.app.AppCompatActivity 12 | import androidx.navigation.findNavController 13 | import androidx.navigation.ui.AppBarConfiguration 14 | import androidx.navigation.ui.navigateUp 15 | import androidx.navigation.ui.onNavDestinationSelected 16 | import androidx.navigation.ui.setupActionBarWithNavController 17 | 18 | class MainActivity : AppCompatActivity() { 19 | 20 | private lateinit var appBarConfiguration: AppBarConfiguration 21 | 22 | override fun onCreate(savedInstanceState: Bundle?) { 23 | super.onCreate(savedInstanceState) 24 | setContentView(R.layout.main_activity) 25 | setupNavigation() 26 | } 27 | 28 | private fun setupNavigation() { 29 | val navController = findNavController(R.id.nav_host_fragment) 30 | appBarConfiguration = AppBarConfiguration(navController.graph) 31 | setupActionBarWithNavController(navController, appBarConfiguration) 32 | } 33 | 34 | override fun onCreateOptionsMenu(menu: Menu?): Boolean { 35 | MenuInflater(applicationContext).inflate(R.menu.options_menu, menu) 36 | return super.onCreateOptionsMenu(menu) 37 | } 38 | 39 | override fun onOptionsItemSelected(item: MenuItem): Boolean = when (item.itemId) { 40 | R.id.aboutFragment -> { 41 | item.onNavDestinationSelected(findNavController(R.id.nav_host_fragment)) 42 | true 43 | } 44 | R.id.action_help -> { 45 | startActivity( 46 | Intent( 47 | Intent.ACTION_VIEW, 48 | Uri.parse(HELP_URL) 49 | ) 50 | ) 51 | true 52 | } 53 | R.id.action_contact -> { 54 | val emailIntent = Intent( 55 | Intent.ACTION_SENDTO, Uri.fromParts( 56 | "mailto", CONTACT_EMAIL, null 57 | ) 58 | ) 59 | try { 60 | startActivity(Intent.createChooser(emailIntent, "Contact TorchExpo")) 61 | } catch (e: ActivityNotFoundException) { 62 | Toast.makeText( 63 | this@MainActivity, 64 | this.getString(R.string.err_no_email_client), 65 | Toast.LENGTH_SHORT 66 | ) 67 | .show() 68 | } 69 | true 70 | } 71 | else -> super.onOptionsItemSelected(item) 72 | } 73 | 74 | override fun onSupportNavigateUp(): Boolean { 75 | val navController = findNavController(R.id.nav_host_fragment) 76 | return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp() 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 |

5 | Android application with collection of machine learning experiments using PyTorch Android API 6 |
7 |
8 | License 10 | PyTorch Android Version 12 | Build Status 13 |

14 | 15 | * [About PyTorch Mobile](#about-pytorch-mobile) 16 | * [What is TorchExpo?](#what-is-torchexpo?) 17 | * [Getting Started](#getting-started) 18 | * [Prerequisites](#prerequisites) 19 | * [Installation](#installation) 20 | * [Contributing](#contributing) 21 | * [License](#license) 22 | 23 | ## About PyTorch Mobile 24 | PyTorch Mobile is an experiment release that provides APIs to build an end-to-end workflow 25 | from Python to deployment on iOS and Android. _[Read more](https://pytorch.org/mobile/home/)_ 26 | 27 |

28 | 29 |

30 | 31 | ### PyTorch Android API 32 | PyTorch Mobile provides Java APIs for integration of Machine Learning models built with Python 33 | into an Android application. It is as simple as importing and using any other Android library. You 34 | can add PyTorch's Gradle dependencies and can run inferences. 35 | _[Read more](https://pytorch.org/mobile/android/)_ 36 | 37 | ## What is TorchExpo? 38 | TorchExpo is an android application which contains collection of machine learning experiments 39 | built using PyTorch and its Android API. This application will allow you to try tasks like Image 40 | Classification with State-Of-The-Art models _(like AlexNet, ResNet, etc.)_. 41 | 42 | ### Built With 43 | * [PyTorch](https://pytorch.org) 44 | * [PyTorch Android API](https://pytorch.org/mobile/android/) 45 | * [Android Ecosystem](https://developer.android.com) 46 | 47 | ## Getting Started 48 | 49 | ### Prerequisites 50 | * [Python 3](https://www.python.org/download/releases/3.0/) 51 | * [Kotlin](https://kotlinlang.org) 52 | * [Android Studio](https://developer.android.com/studio) 53 | 54 | ### Installation 55 | * Git clone this/forked repository 56 | ```shell script 57 | git clone https://github.com/prabhuomkar/TorchExpo.git 58 | OR 59 | git clone https://github.com//TorchExpo.git 60 | ``` 61 | * [Android Setup Guide](https://prabhuomkar.github.io/TorchExpo/#/getting-started?id=android-studio-setup) 62 | * [PyTorch Models Setup Guide](https://prabhuomkar.github.io/TorchExpo/#/getting-started?id=pytorch-setup) 63 | 64 | ## Contributing 65 | We appreciate all contributions. If you are planning to contribute back bug-fixes, please do so 66 | without any further discussion. 67 | 68 | If you plan to contribute new features, utility functions or any application upgrades, please first 69 | open an issue and discuss the feature with us. Sending a PR without discussion might end up 70 | resulting in a rejected PR, because we might be taking the project in a different direction 71 | than you might be aware of. 72 | 73 | Please refer our [Contribution Guide](https://prabhuomkar.github.io/TorchExpo/#/contributing) for more details. 74 | 75 | ## License 76 | This project is licensed under Apache-2.0 as given in [LICENSE](LICENSE) file. -------------------------------------------------------------------------------- /app/src/main/res/values/font_certs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @array/com_google_android_gms_fonts_certs_dev 5 | @array/com_google_android_gms_fonts_certs_prod 6 | 7 | 8 | 9 | MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs= 10 | 11 | 12 | 13 | 14 | MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /models/image_classification.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "Image Classification.ipynb", 7 | "provenance": [] 8 | }, 9 | "kernelspec": { 10 | "name": "python3", 11 | "display_name": "Python 3" 12 | } 13 | }, 14 | "cells": [ 15 | { 16 | "cell_type": "code", 17 | "metadata": { 18 | "id": "0yvcM-BkjoRm", 19 | "colab_type": "code", 20 | "colab": {} 21 | }, 22 | "source": [ 23 | "import torch\n", 24 | "import torchvision" 25 | ], 26 | "execution_count": 0, 27 | "outputs": [] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "metadata": { 32 | "id": "L-rUlb7FlNb-", 33 | "colab_type": "code", 34 | "colab": { 35 | "base_uri": "https://localhost:8080/", 36 | "height": 51 37 | }, 38 | "outputId": "8511f1f5-b331-4faf-9ec1-7094e76d0c50" 39 | }, 40 | "source": [ 41 | "print(torch.__version__)\n", 42 | "print(torchvision.__version__)" 43 | ], 44 | "execution_count": 2, 45 | "outputs": [ 46 | { 47 | "output_type": "stream", 48 | "text": [ 49 | "1.4.0\n", 50 | "0.5.0\n" 51 | ], 52 | "name": "stdout" 53 | } 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "metadata": { 59 | "id": "l2BAv0oujwdr", 60 | "colab_type": "code", 61 | "colab": {} 62 | }, 63 | "source": [ 64 | "\"\"\"AlexNet\"\"\"\n", 65 | "# load alexnet model\n", 66 | "alexnet = torchvision.models.alexnet(pretrained=True)\n", 67 | "alexnet.eval()\n", 68 | "# example tensor as input\n", 69 | "alexnet_example = torch.rand(1, 3, 224, 224)\n", 70 | "# create torchscript serialized pytorch pretrained model\n", 71 | "alexnet_traced_script_module = torch.jit.trace(alexnet, alexnet_example)\n", 72 | "alexnet_traced_script_module.save(\"alexnet.pt\")" 73 | ], 74 | "execution_count": 0, 75 | "outputs": [] 76 | }, 77 | { 78 | "cell_type": "code", 79 | "metadata": { 80 | "id": "WE2UoFFBj-uZ", 81 | "colab_type": "code", 82 | "colab": {} 83 | }, 84 | "source": [ 85 | "\"\"\"ResNet-18\"\"\"\n", 86 | "# load resnet model\n", 87 | "resnet18 = torchvision.models.resnet18(pretrained=True)\n", 88 | "resnet18.eval()\n", 89 | "# example tensor as input\n", 90 | "resnet18_example = torch.rand(1, 3, 224, 224)\n", 91 | "# create torchscript serialized pytorch pretrained model\n", 92 | "resnet18_traced_script_module = torch.jit.trace(resnet18, resnet18_example)\n", 93 | "resnet18_traced_script_module.save(\"resnet_18.pt\")" 94 | ], 95 | "execution_count": 0, 96 | "outputs": [] 97 | }, 98 | { 99 | "cell_type": "code", 100 | "metadata": { 101 | "id": "CfYRBq0dlHx5", 102 | "colab_type": "code", 103 | "colab": {} 104 | }, 105 | "source": [ 106 | "\"\"\"GoogleNet\"\"\"\n", 107 | "# load googlenet model\n", 108 | "googlenet = torchvision.models.googlenet(pretrained=True)\n", 109 | "googlenet.eval()\n", 110 | "# example tensor as input\n", 111 | "googlenet_example = torch.rand(1, 3, 224, 224)\n", 112 | "# create torchscript serialized pytorch pretrained model\n", 113 | "googlenet_traced_script_module = torch.jit.trace(googlenet, googlenet_example)\n", 114 | "googlenet_traced_script_module.save(\"googlenet.pt\")" 115 | ], 116 | "execution_count": 0, 117 | "outputs": [] 118 | } 119 | ] 120 | } -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /docs/privacy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | TorchExpo - Privacy Policy 15 | 16 | 17 | 18 | 19 |
20 |

Privacy Policy

21 |

22 | Omkar Prabhu built the TorchExpo app as an Open Source app. This SERVICE 23 | is provided by Omkar Prabhu at no cost and is intended for use as is. 24 |

25 |

26 | This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service. 27 |

28 |

29 | If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy. 30 |

31 |

32 | The terms used in this Privacy Policy have the same meanings as in our Terms and 33 | Conditions, which is accessible at TorchExpo unless otherwise defined in this Privacy 34 | Policy. 35 |

36 |

Information Collection and Use

37 |

38 | For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information. The information that I request will be retained on your device and is not collected by me in any way. 39 |

40 |

41 | The app does use third party services that may collect information used to identify you. 42 |

43 |
44 |

45 | Link to privacy policy of third party service providers used by the app 46 |

47 | 50 |
51 |

Log Data

52 |

53 | I want to inform you that whenever you use my Service, in a case of an error in the app I collect data and information (through third party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing my Service, the time and date of your use of the Service, and other statistics. 54 |

55 |

Cookies

56 |

57 | Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device's internal memory. 58 |

59 |

60 | This Service does not use these “cookies” explicitly. However, the app may use third party code and libraries that use “cookies” to collect information and improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service. 61 |

62 |

Service Providers

63 |

64 | I may employ third-party companies and individuals due to the following reasons: 65 |

66 |
    67 |
  • To facilitate our Service;
  • 68 |
  • To provide the Service on our behalf;
  • 69 |
  • To perform Service-related services; or
  • 70 |
  • To assist us in analyzing how our Service is used.
  • 71 |
72 |

73 | I want to inform users of this Service that these third parties have access to your Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose. 74 |

75 |

Security

76 |

77 | I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security. 78 |

79 |

Links to Other Sites

80 |

81 | This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services. 82 |

83 |

Children's Privacy

84 |

85 | These Services do not address anyone under the age of 13. I do not knowingly collect personally identifiable information from children under 13. In the case I discover that a child under 13 has provided me with personal information, I immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact me so that I will be able to do necessary actions. 86 |

87 |

Changes to This Privacy Policy

88 |

89 | I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page. These changes are effective immediately after they are posted on this page. 90 |

91 |

Contact Us

92 |

93 | If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at prabhuomkar@pm.me 94 |

95 |
96 | 97 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2020 Omkar Prabhu 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /models/image_segmentation.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "image_segmentation.ipynb", 7 | "provenance": [] 8 | }, 9 | "kernelspec": { 10 | "name": "python3", 11 | "display_name": "Python 3" 12 | }, 13 | "widgets": { 14 | "application/vnd.jupyter.widget-state+json": { 15 | "75ab0b7a6d804f93a574a0ba2ece1a50": { 16 | "model_module": "@jupyter-widgets/controls", 17 | "model_name": "HBoxModel", 18 | "state": { 19 | "_view_name": "HBoxView", 20 | "_dom_classes": [], 21 | "_model_name": "HBoxModel", 22 | "_view_module": "@jupyter-widgets/controls", 23 | "_model_module_version": "1.5.0", 24 | "_view_count": null, 25 | "_view_module_version": "1.5.0", 26 | "box_style": "", 27 | "layout": "IPY_MODEL_f4b915078dc8465d8f06f672c84bbdae", 28 | "_model_module": "@jupyter-widgets/controls", 29 | "children": [ 30 | "IPY_MODEL_843a20f4a2c04a1386d0ea66b506d3f2", 31 | "IPY_MODEL_ff7d3ef6f06a4a2fab71babd49f83bca" 32 | ] 33 | } 34 | }, 35 | "f4b915078dc8465d8f06f672c84bbdae": { 36 | "model_module": "@jupyter-widgets/base", 37 | "model_name": "LayoutModel", 38 | "state": { 39 | "_view_name": "LayoutView", 40 | "grid_template_rows": null, 41 | "right": null, 42 | "justify_content": null, 43 | "_view_module": "@jupyter-widgets/base", 44 | "overflow": null, 45 | "_model_module_version": "1.2.0", 46 | "_view_count": null, 47 | "flex_flow": null, 48 | "width": null, 49 | "min_width": null, 50 | "border": null, 51 | "align_items": null, 52 | "bottom": null, 53 | "_model_module": "@jupyter-widgets/base", 54 | "top": null, 55 | "grid_column": null, 56 | "overflow_y": null, 57 | "overflow_x": null, 58 | "grid_auto_flow": null, 59 | "grid_area": null, 60 | "grid_template_columns": null, 61 | "flex": null, 62 | "_model_name": "LayoutModel", 63 | "justify_items": null, 64 | "grid_row": null, 65 | "max_height": null, 66 | "align_content": null, 67 | "visibility": null, 68 | "align_self": null, 69 | "height": null, 70 | "min_height": null, 71 | "padding": null, 72 | "grid_auto_rows": null, 73 | "grid_gap": null, 74 | "max_width": null, 75 | "order": null, 76 | "_view_module_version": "1.2.0", 77 | "grid_template_areas": null, 78 | "object_position": null, 79 | "object_fit": null, 80 | "grid_auto_columns": null, 81 | "margin": null, 82 | "display": null, 83 | "left": null 84 | } 85 | }, 86 | "843a20f4a2c04a1386d0ea66b506d3f2": { 87 | "model_module": "@jupyter-widgets/controls", 88 | "model_name": "FloatProgressModel", 89 | "state": { 90 | "_view_name": "ProgressView", 91 | "style": "IPY_MODEL_fc26dda3f25d45f48fc24c4e20529884", 92 | "_dom_classes": [], 93 | "description": "100%", 94 | "_model_name": "FloatProgressModel", 95 | "bar_style": "success", 96 | "max": 178728960, 97 | "_view_module": "@jupyter-widgets/controls", 98 | "_model_module_version": "1.5.0", 99 | "value": 178728960, 100 | "_view_count": null, 101 | "_view_module_version": "1.5.0", 102 | "orientation": "horizontal", 103 | "min": 0, 104 | "description_tooltip": null, 105 | "_model_module": "@jupyter-widgets/controls", 106 | "layout": "IPY_MODEL_f4aa0e88499b4b2c8e6b609ca9fe1e8d" 107 | } 108 | }, 109 | "ff7d3ef6f06a4a2fab71babd49f83bca": { 110 | "model_module": "@jupyter-widgets/controls", 111 | "model_name": "HTMLModel", 112 | "state": { 113 | "_view_name": "HTMLView", 114 | "style": "IPY_MODEL_d2964b37745e4de9ba85b97eed987968", 115 | "_dom_classes": [], 116 | "description": "", 117 | "_model_name": "HTMLModel", 118 | "placeholder": "​", 119 | "_view_module": "@jupyter-widgets/controls", 120 | "_model_module_version": "1.5.0", 121 | "value": " 170M/170M [00:07<00:00, 24.2MB/s]", 122 | "_view_count": null, 123 | "_view_module_version": "1.5.0", 124 | "description_tooltip": null, 125 | "_model_module": "@jupyter-widgets/controls", 126 | "layout": "IPY_MODEL_85e12dd66e52492f981b9e0518ed3bb1" 127 | } 128 | }, 129 | "fc26dda3f25d45f48fc24c4e20529884": { 130 | "model_module": "@jupyter-widgets/controls", 131 | "model_name": "ProgressStyleModel", 132 | "state": { 133 | "_view_name": "StyleView", 134 | "_model_name": "ProgressStyleModel", 135 | "description_width": "initial", 136 | "_view_module": "@jupyter-widgets/base", 137 | "_model_module_version": "1.5.0", 138 | "_view_count": null, 139 | "_view_module_version": "1.2.0", 140 | "bar_color": null, 141 | "_model_module": "@jupyter-widgets/controls" 142 | } 143 | }, 144 | "f4aa0e88499b4b2c8e6b609ca9fe1e8d": { 145 | "model_module": "@jupyter-widgets/base", 146 | "model_name": "LayoutModel", 147 | "state": { 148 | "_view_name": "LayoutView", 149 | "grid_template_rows": null, 150 | "right": null, 151 | "justify_content": null, 152 | "_view_module": "@jupyter-widgets/base", 153 | "overflow": null, 154 | "_model_module_version": "1.2.0", 155 | "_view_count": null, 156 | "flex_flow": null, 157 | "width": null, 158 | "min_width": null, 159 | "border": null, 160 | "align_items": null, 161 | "bottom": null, 162 | "_model_module": "@jupyter-widgets/base", 163 | "top": null, 164 | "grid_column": null, 165 | "overflow_y": null, 166 | "overflow_x": null, 167 | "grid_auto_flow": null, 168 | "grid_area": null, 169 | "grid_template_columns": null, 170 | "flex": null, 171 | "_model_name": "LayoutModel", 172 | "justify_items": null, 173 | "grid_row": null, 174 | "max_height": null, 175 | "align_content": null, 176 | "visibility": null, 177 | "align_self": null, 178 | "height": null, 179 | "min_height": null, 180 | "padding": null, 181 | "grid_auto_rows": null, 182 | "grid_gap": null, 183 | "max_width": null, 184 | "order": null, 185 | "_view_module_version": "1.2.0", 186 | "grid_template_areas": null, 187 | "object_position": null, 188 | "object_fit": null, 189 | "grid_auto_columns": null, 190 | "margin": null, 191 | "display": null, 192 | "left": null 193 | } 194 | }, 195 | "d2964b37745e4de9ba85b97eed987968": { 196 | "model_module": "@jupyter-widgets/controls", 197 | "model_name": "DescriptionStyleModel", 198 | "state": { 199 | "_view_name": "StyleView", 200 | "_model_name": "DescriptionStyleModel", 201 | "description_width": "", 202 | "_view_module": "@jupyter-widgets/base", 203 | "_model_module_version": "1.5.0", 204 | "_view_count": null, 205 | "_view_module_version": "1.2.0", 206 | "_model_module": "@jupyter-widgets/controls" 207 | } 208 | }, 209 | "85e12dd66e52492f981b9e0518ed3bb1": { 210 | "model_module": "@jupyter-widgets/base", 211 | "model_name": "LayoutModel", 212 | "state": { 213 | "_view_name": "LayoutView", 214 | "grid_template_rows": null, 215 | "right": null, 216 | "justify_content": null, 217 | "_view_module": "@jupyter-widgets/base", 218 | "overflow": null, 219 | "_model_module_version": "1.2.0", 220 | "_view_count": null, 221 | "flex_flow": null, 222 | "width": null, 223 | "min_width": null, 224 | "border": null, 225 | "align_items": null, 226 | "bottom": null, 227 | "_model_module": "@jupyter-widgets/base", 228 | "top": null, 229 | "grid_column": null, 230 | "overflow_y": null, 231 | "overflow_x": null, 232 | "grid_auto_flow": null, 233 | "grid_area": null, 234 | "grid_template_columns": null, 235 | "flex": null, 236 | "_model_name": "LayoutModel", 237 | "justify_items": null, 238 | "grid_row": null, 239 | "max_height": null, 240 | "align_content": null, 241 | "visibility": null, 242 | "align_self": null, 243 | "height": null, 244 | "min_height": null, 245 | "padding": null, 246 | "grid_auto_rows": null, 247 | "grid_gap": null, 248 | "max_width": null, 249 | "order": null, 250 | "_view_module_version": "1.2.0", 251 | "grid_template_areas": null, 252 | "object_position": null, 253 | "object_fit": null, 254 | "grid_auto_columns": null, 255 | "margin": null, 256 | "display": null, 257 | "left": null 258 | } 259 | }, 260 | "fa14f81544254fa38418fd8df0586a73": { 261 | "model_module": "@jupyter-widgets/controls", 262 | "model_name": "HBoxModel", 263 | "state": { 264 | "_view_name": "HBoxView", 265 | "_dom_classes": [], 266 | "_model_name": "HBoxModel", 267 | "_view_module": "@jupyter-widgets/controls", 268 | "_model_module_version": "1.5.0", 269 | "_view_count": null, 270 | "_view_module_version": "1.5.0", 271 | "box_style": "", 272 | "layout": "IPY_MODEL_313f087449354e7395a9a8078f5a32b3", 273 | "_model_module": "@jupyter-widgets/controls", 274 | "children": [ 275 | "IPY_MODEL_d0bfeefb99714549996078b75e631fd5", 276 | "IPY_MODEL_f4f0f75ea6574e848c775d213e10ac20" 277 | ] 278 | } 279 | }, 280 | "313f087449354e7395a9a8078f5a32b3": { 281 | "model_module": "@jupyter-widgets/base", 282 | "model_name": "LayoutModel", 283 | "state": { 284 | "_view_name": "LayoutView", 285 | "grid_template_rows": null, 286 | "right": null, 287 | "justify_content": null, 288 | "_view_module": "@jupyter-widgets/base", 289 | "overflow": null, 290 | "_model_module_version": "1.2.0", 291 | "_view_count": null, 292 | "flex_flow": null, 293 | "width": null, 294 | "min_width": null, 295 | "border": null, 296 | "align_items": null, 297 | "bottom": null, 298 | "_model_module": "@jupyter-widgets/base", 299 | "top": null, 300 | "grid_column": null, 301 | "overflow_y": null, 302 | "overflow_x": null, 303 | "grid_auto_flow": null, 304 | "grid_area": null, 305 | "grid_template_columns": null, 306 | "flex": null, 307 | "_model_name": "LayoutModel", 308 | "justify_items": null, 309 | "grid_row": null, 310 | "max_height": null, 311 | "align_content": null, 312 | "visibility": null, 313 | "align_self": null, 314 | "height": null, 315 | "min_height": null, 316 | "padding": null, 317 | "grid_auto_rows": null, 318 | "grid_gap": null, 319 | "max_width": null, 320 | "order": null, 321 | "_view_module_version": "1.2.0", 322 | "grid_template_areas": null, 323 | "object_position": null, 324 | "object_fit": null, 325 | "grid_auto_columns": null, 326 | "margin": null, 327 | "display": null, 328 | "left": null 329 | } 330 | }, 331 | "d0bfeefb99714549996078b75e631fd5": { 332 | "model_module": "@jupyter-widgets/controls", 333 | "model_name": "FloatProgressModel", 334 | "state": { 335 | "_view_name": "ProgressView", 336 | "style": "IPY_MODEL_d59ce7884cdd43bea7478e4849b274c2", 337 | "_dom_classes": [], 338 | "description": "100%", 339 | "_model_name": "FloatProgressModel", 340 | "bar_style": "success", 341 | "max": 217800805, 342 | "_view_module": "@jupyter-widgets/controls", 343 | "_model_module_version": "1.5.0", 344 | "value": 217800805, 345 | "_view_count": null, 346 | "_view_module_version": "1.5.0", 347 | "orientation": "horizontal", 348 | "min": 0, 349 | "description_tooltip": null, 350 | "_model_module": "@jupyter-widgets/controls", 351 | "layout": "IPY_MODEL_81d2aaf5a92b4c55bfc9a8d363dca106" 352 | } 353 | }, 354 | "f4f0f75ea6574e848c775d213e10ac20": { 355 | "model_module": "@jupyter-widgets/controls", 356 | "model_name": "HTMLModel", 357 | "state": { 358 | "_view_name": "HTMLView", 359 | "style": "IPY_MODEL_a617ecce90284874b7f439f9589879d5", 360 | "_dom_classes": [], 361 | "description": "", 362 | "_model_name": "HTMLModel", 363 | "placeholder": "​", 364 | "_view_module": "@jupyter-widgets/controls", 365 | "_model_module_version": "1.5.0", 366 | "value": " 208M/208M [00:03<00:00, 57.8MB/s]", 367 | "_view_count": null, 368 | "_view_module_version": "1.5.0", 369 | "description_tooltip": null, 370 | "_model_module": "@jupyter-widgets/controls", 371 | "layout": "IPY_MODEL_961e7ff1ef18449396fb6542daaa5129" 372 | } 373 | }, 374 | "d59ce7884cdd43bea7478e4849b274c2": { 375 | "model_module": "@jupyter-widgets/controls", 376 | "model_name": "ProgressStyleModel", 377 | "state": { 378 | "_view_name": "StyleView", 379 | "_model_name": "ProgressStyleModel", 380 | "description_width": "initial", 381 | "_view_module": "@jupyter-widgets/base", 382 | "_model_module_version": "1.5.0", 383 | "_view_count": null, 384 | "_view_module_version": "1.2.0", 385 | "bar_color": null, 386 | "_model_module": "@jupyter-widgets/controls" 387 | } 388 | }, 389 | "81d2aaf5a92b4c55bfc9a8d363dca106": { 390 | "model_module": "@jupyter-widgets/base", 391 | "model_name": "LayoutModel", 392 | "state": { 393 | "_view_name": "LayoutView", 394 | "grid_template_rows": null, 395 | "right": null, 396 | "justify_content": null, 397 | "_view_module": "@jupyter-widgets/base", 398 | "overflow": null, 399 | "_model_module_version": "1.2.0", 400 | "_view_count": null, 401 | "flex_flow": null, 402 | "width": null, 403 | "min_width": null, 404 | "border": null, 405 | "align_items": null, 406 | "bottom": null, 407 | "_model_module": "@jupyter-widgets/base", 408 | "top": null, 409 | "grid_column": null, 410 | "overflow_y": null, 411 | "overflow_x": null, 412 | "grid_auto_flow": null, 413 | "grid_area": null, 414 | "grid_template_columns": null, 415 | "flex": null, 416 | "_model_name": "LayoutModel", 417 | "justify_items": null, 418 | "grid_row": null, 419 | "max_height": null, 420 | "align_content": null, 421 | "visibility": null, 422 | "align_self": null, 423 | "height": null, 424 | "min_height": null, 425 | "padding": null, 426 | "grid_auto_rows": null, 427 | "grid_gap": null, 428 | "max_width": null, 429 | "order": null, 430 | "_view_module_version": "1.2.0", 431 | "grid_template_areas": null, 432 | "object_position": null, 433 | "object_fit": null, 434 | "grid_auto_columns": null, 435 | "margin": null, 436 | "display": null, 437 | "left": null 438 | } 439 | }, 440 | "a617ecce90284874b7f439f9589879d5": { 441 | "model_module": "@jupyter-widgets/controls", 442 | "model_name": "DescriptionStyleModel", 443 | "state": { 444 | "_view_name": "StyleView", 445 | "_model_name": "DescriptionStyleModel", 446 | "description_width": "", 447 | "_view_module": "@jupyter-widgets/base", 448 | "_model_module_version": "1.5.0", 449 | "_view_count": null, 450 | "_view_module_version": "1.2.0", 451 | "_model_module": "@jupyter-widgets/controls" 452 | } 453 | }, 454 | "961e7ff1ef18449396fb6542daaa5129": { 455 | "model_module": "@jupyter-widgets/base", 456 | "model_name": "LayoutModel", 457 | "state": { 458 | "_view_name": "LayoutView", 459 | "grid_template_rows": null, 460 | "right": null, 461 | "justify_content": null, 462 | "_view_module": "@jupyter-widgets/base", 463 | "overflow": null, 464 | "_model_module_version": "1.2.0", 465 | "_view_count": null, 466 | "flex_flow": null, 467 | "width": null, 468 | "min_width": null, 469 | "border": null, 470 | "align_items": null, 471 | "bottom": null, 472 | "_model_module": "@jupyter-widgets/base", 473 | "top": null, 474 | "grid_column": null, 475 | "overflow_y": null, 476 | "overflow_x": null, 477 | "grid_auto_flow": null, 478 | "grid_area": null, 479 | "grid_template_columns": null, 480 | "flex": null, 481 | "_model_name": "LayoutModel", 482 | "justify_items": null, 483 | "grid_row": null, 484 | "max_height": null, 485 | "align_content": null, 486 | "visibility": null, 487 | "align_self": null, 488 | "height": null, 489 | "min_height": null, 490 | "padding": null, 491 | "grid_auto_rows": null, 492 | "grid_gap": null, 493 | "max_width": null, 494 | "order": null, 495 | "_view_module_version": "1.2.0", 496 | "grid_template_areas": null, 497 | "object_position": null, 498 | "object_fit": null, 499 | "grid_auto_columns": null, 500 | "margin": null, 501 | "display": null, 502 | "left": null 503 | } 504 | }, 505 | "1eca330d27a9430e85e5257b96be066b": { 506 | "model_module": "@jupyter-widgets/controls", 507 | "model_name": "HBoxModel", 508 | "state": { 509 | "_view_name": "HBoxView", 510 | "_dom_classes": [], 511 | "_model_name": "HBoxModel", 512 | "_view_module": "@jupyter-widgets/controls", 513 | "_model_module_version": "1.5.0", 514 | "_view_count": null, 515 | "_view_module_version": "1.5.0", 516 | "box_style": "", 517 | "layout": "IPY_MODEL_90cac4dfde3f46ac8594ed67ad0adf53", 518 | "_model_module": "@jupyter-widgets/controls", 519 | "children": [ 520 | "IPY_MODEL_de27b48e3ce0416da3bdb664e4db7b4f", 521 | "IPY_MODEL_66aad7a4101b4734be990a31ee7dad00" 522 | ] 523 | } 524 | }, 525 | "90cac4dfde3f46ac8594ed67ad0adf53": { 526 | "model_module": "@jupyter-widgets/base", 527 | "model_name": "LayoutModel", 528 | "state": { 529 | "_view_name": "LayoutView", 530 | "grid_template_rows": null, 531 | "right": null, 532 | "justify_content": null, 533 | "_view_module": "@jupyter-widgets/base", 534 | "overflow": null, 535 | "_model_module_version": "1.2.0", 536 | "_view_count": null, 537 | "flex_flow": null, 538 | "width": null, 539 | "min_width": null, 540 | "border": null, 541 | "align_items": null, 542 | "bottom": null, 543 | "_model_module": "@jupyter-widgets/base", 544 | "top": null, 545 | "grid_column": null, 546 | "overflow_y": null, 547 | "overflow_x": null, 548 | "grid_auto_flow": null, 549 | "grid_area": null, 550 | "grid_template_columns": null, 551 | "flex": null, 552 | "_model_name": "LayoutModel", 553 | "justify_items": null, 554 | "grid_row": null, 555 | "max_height": null, 556 | "align_content": null, 557 | "visibility": null, 558 | "align_self": null, 559 | "height": null, 560 | "min_height": null, 561 | "padding": null, 562 | "grid_auto_rows": null, 563 | "grid_gap": null, 564 | "max_width": null, 565 | "order": null, 566 | "_view_module_version": "1.2.0", 567 | "grid_template_areas": null, 568 | "object_position": null, 569 | "object_fit": null, 570 | "grid_auto_columns": null, 571 | "margin": null, 572 | "display": null, 573 | "left": null 574 | } 575 | }, 576 | "de27b48e3ce0416da3bdb664e4db7b4f": { 577 | "model_module": "@jupyter-widgets/controls", 578 | "model_name": "FloatProgressModel", 579 | "state": { 580 | "_view_name": "ProgressView", 581 | "style": "IPY_MODEL_3bdcefab5b064cee9803d4a1d3e290f0", 582 | "_dom_classes": [], 583 | "description": "100%", 584 | "_model_name": "FloatProgressModel", 585 | "bar_style": "success", 586 | "max": 244545539, 587 | "_view_module": "@jupyter-widgets/controls", 588 | "_model_module_version": "1.5.0", 589 | "value": 244545539, 590 | "_view_count": null, 591 | "_view_module_version": "1.5.0", 592 | "orientation": "horizontal", 593 | "min": 0, 594 | "description_tooltip": null, 595 | "_model_module": "@jupyter-widgets/controls", 596 | "layout": "IPY_MODEL_7857076f048744cda1c8fe5222168296" 597 | } 598 | }, 599 | "66aad7a4101b4734be990a31ee7dad00": { 600 | "model_module": "@jupyter-widgets/controls", 601 | "model_name": "HTMLModel", 602 | "state": { 603 | "_view_name": "HTMLView", 604 | "style": "IPY_MODEL_1278e6bc089c48b9bd1f08fc30b6eb5d", 605 | "_dom_classes": [], 606 | "description": "", 607 | "_model_name": "HTMLModel", 608 | "placeholder": "​", 609 | "_view_module": "@jupyter-widgets/controls", 610 | "_model_module_version": "1.5.0", 611 | "value": " 233M/233M [00:03<00:00, 74.8MB/s]", 612 | "_view_count": null, 613 | "_view_module_version": "1.5.0", 614 | "description_tooltip": null, 615 | "_model_module": "@jupyter-widgets/controls", 616 | "layout": "IPY_MODEL_4c50d1e036f3401d8cd92817ae0edb2b" 617 | } 618 | }, 619 | "3bdcefab5b064cee9803d4a1d3e290f0": { 620 | "model_module": "@jupyter-widgets/controls", 621 | "model_name": "ProgressStyleModel", 622 | "state": { 623 | "_view_name": "StyleView", 624 | "_model_name": "ProgressStyleModel", 625 | "description_width": "initial", 626 | "_view_module": "@jupyter-widgets/base", 627 | "_model_module_version": "1.5.0", 628 | "_view_count": null, 629 | "_view_module_version": "1.2.0", 630 | "bar_color": null, 631 | "_model_module": "@jupyter-widgets/controls" 632 | } 633 | }, 634 | "7857076f048744cda1c8fe5222168296": { 635 | "model_module": "@jupyter-widgets/base", 636 | "model_name": "LayoutModel", 637 | "state": { 638 | "_view_name": "LayoutView", 639 | "grid_template_rows": null, 640 | "right": null, 641 | "justify_content": null, 642 | "_view_module": "@jupyter-widgets/base", 643 | "overflow": null, 644 | "_model_module_version": "1.2.0", 645 | "_view_count": null, 646 | "flex_flow": null, 647 | "width": null, 648 | "min_width": null, 649 | "border": null, 650 | "align_items": null, 651 | "bottom": null, 652 | "_model_module": "@jupyter-widgets/base", 653 | "top": null, 654 | "grid_column": null, 655 | "overflow_y": null, 656 | "overflow_x": null, 657 | "grid_auto_flow": null, 658 | "grid_area": null, 659 | "grid_template_columns": null, 660 | "flex": null, 661 | "_model_name": "LayoutModel", 662 | "justify_items": null, 663 | "grid_row": null, 664 | "max_height": null, 665 | "align_content": null, 666 | "visibility": null, 667 | "align_self": null, 668 | "height": null, 669 | "min_height": null, 670 | "padding": null, 671 | "grid_auto_rows": null, 672 | "grid_gap": null, 673 | "max_width": null, 674 | "order": null, 675 | "_view_module_version": "1.2.0", 676 | "grid_template_areas": null, 677 | "object_position": null, 678 | "object_fit": null, 679 | "grid_auto_columns": null, 680 | "margin": null, 681 | "display": null, 682 | "left": null 683 | } 684 | }, 685 | "1278e6bc089c48b9bd1f08fc30b6eb5d": { 686 | "model_module": "@jupyter-widgets/controls", 687 | "model_name": "DescriptionStyleModel", 688 | "state": { 689 | "_view_name": "StyleView", 690 | "_model_name": "DescriptionStyleModel", 691 | "description_width": "", 692 | "_view_module": "@jupyter-widgets/base", 693 | "_model_module_version": "1.5.0", 694 | "_view_count": null, 695 | "_view_module_version": "1.2.0", 696 | "_model_module": "@jupyter-widgets/controls" 697 | } 698 | }, 699 | "4c50d1e036f3401d8cd92817ae0edb2b": { 700 | "model_module": "@jupyter-widgets/base", 701 | "model_name": "LayoutModel", 702 | "state": { 703 | "_view_name": "LayoutView", 704 | "grid_template_rows": null, 705 | "right": null, 706 | "justify_content": null, 707 | "_view_module": "@jupyter-widgets/base", 708 | "overflow": null, 709 | "_model_module_version": "1.2.0", 710 | "_view_count": null, 711 | "flex_flow": null, 712 | "width": null, 713 | "min_width": null, 714 | "border": null, 715 | "align_items": null, 716 | "bottom": null, 717 | "_model_module": "@jupyter-widgets/base", 718 | "top": null, 719 | "grid_column": null, 720 | "overflow_y": null, 721 | "overflow_x": null, 722 | "grid_auto_flow": null, 723 | "grid_area": null, 724 | "grid_template_columns": null, 725 | "flex": null, 726 | "_model_name": "LayoutModel", 727 | "justify_items": null, 728 | "grid_row": null, 729 | "max_height": null, 730 | "align_content": null, 731 | "visibility": null, 732 | "align_self": null, 733 | "height": null, 734 | "min_height": null, 735 | "padding": null, 736 | "grid_auto_rows": null, 737 | "grid_gap": null, 738 | "max_width": null, 739 | "order": null, 740 | "_view_module_version": "1.2.0", 741 | "grid_template_areas": null, 742 | "object_position": null, 743 | "object_fit": null, 744 | "grid_auto_columns": null, 745 | "margin": null, 746 | "display": null, 747 | "left": null 748 | } 749 | } 750 | } 751 | } 752 | }, 753 | "cells": [ 754 | { 755 | "cell_type": "code", 756 | "metadata": { 757 | "id": "V2ccBDwMmcMG", 758 | "colab_type": "code", 759 | "colab": { 760 | "base_uri": "https://localhost:8080/", 761 | "height": 34 762 | }, 763 | "outputId": "f3596ece-72a9-44c7-fd77-ba8552cc684b" 764 | }, 765 | "source": [ 766 | "!pip uninstall torch" 767 | ], 768 | "execution_count": 1, 769 | "outputs": [ 770 | { 771 | "output_type": "stream", 772 | "text": [ 773 | "\u001b[33mWARNING: Skipping torch as it is not installed.\u001b[0m\n" 774 | ], 775 | "name": "stdout" 776 | } 777 | ] 778 | }, 779 | { 780 | "cell_type": "code", 781 | "metadata": { 782 | "id": "BMqStOkCmrwS", 783 | "colab_type": "code", 784 | "colab": { 785 | "base_uri": "https://localhost:8080/", 786 | "height": 170 787 | }, 788 | "outputId": "8cecd5f1-d4d2-457d-c5f2-23fbc1326dd5" 789 | }, 790 | "source": [ 791 | "!pip install --pre torch -f https://download.pytorch.org/whl/nightly/cu101/torch_nightly.html" 792 | ], 793 | "execution_count": 2, 794 | "outputs": [ 795 | { 796 | "output_type": "stream", 797 | "text": [ 798 | "Looking in links: https://download.pytorch.org/whl/nightly/cu101/torch_nightly.html\n", 799 | "Collecting torch\n", 800 | "\u001b[?25l Downloading https://download.pytorch.org/whl/nightly/cu101/torch-1.6.0.dev20200528%2Bcu101-cp36-cp36m-linux_x86_64.whl (765.5MB)\n", 801 | "\u001b[K |████████████████████████████████| 765.5MB 20kB/s \n", 802 | "\u001b[?25hRequirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from torch) (1.18.4)\n", 803 | "Requirement already satisfied: future in /usr/local/lib/python3.6/dist-packages (from torch) (0.16.0)\n", 804 | "\u001b[31mERROR: fastai 1.0.61 requires torchvision, which is not installed.\u001b[0m\n", 805 | "Installing collected packages: torch\n", 806 | "Successfully installed torch-1.6.0.dev20200528+cu101\n" 807 | ], 808 | "name": "stdout" 809 | } 810 | ] 811 | }, 812 | { 813 | "cell_type": "code", 814 | "metadata": { 815 | "id": "m8WLc_tmm_-m", 816 | "colab_type": "code", 817 | "colab": {} 818 | }, 819 | "source": [ 820 | "import torch" 821 | ], 822 | "execution_count": 0, 823 | "outputs": [] 824 | }, 825 | { 826 | "cell_type": "code", 827 | "metadata": { 828 | "id": "Hz_If778nA6v", 829 | "colab_type": "code", 830 | "colab": { 831 | "base_uri": "https://localhost:8080/", 832 | "height": 34 833 | }, 834 | "outputId": "fa7dbc1f-57b9-4906-88e6-a55bb9ec0ac0" 835 | }, 836 | "source": [ 837 | "print(torch.__version__)" 838 | ], 839 | "execution_count": 4, 840 | "outputs": [ 841 | { 842 | "output_type": "stream", 843 | "text": [ 844 | "1.6.0.dev20200528+cu101\n" 845 | ], 846 | "name": "stdout" 847 | } 848 | ] 849 | }, 850 | { 851 | "cell_type": "code", 852 | "metadata": { 853 | "id": "MQ4piRfanCep", 854 | "colab_type": "code", 855 | "colab": { 856 | "base_uri": "https://localhost:8080/", 857 | "height": 186, 858 | "referenced_widgets": [ 859 | "75ab0b7a6d804f93a574a0ba2ece1a50", 860 | "f4b915078dc8465d8f06f672c84bbdae", 861 | "843a20f4a2c04a1386d0ea66b506d3f2", 862 | "ff7d3ef6f06a4a2fab71babd49f83bca", 863 | "fc26dda3f25d45f48fc24c4e20529884", 864 | "f4aa0e88499b4b2c8e6b609ca9fe1e8d", 865 | "d2964b37745e4de9ba85b97eed987968", 866 | "85e12dd66e52492f981b9e0518ed3bb1", 867 | "fa14f81544254fa38418fd8df0586a73", 868 | "313f087449354e7395a9a8078f5a32b3", 869 | "d0bfeefb99714549996078b75e631fd5", 870 | "f4f0f75ea6574e848c775d213e10ac20", 871 | "d59ce7884cdd43bea7478e4849b274c2", 872 | "81d2aaf5a92b4c55bfc9a8d363dca106", 873 | "a617ecce90284874b7f439f9589879d5", 874 | "961e7ff1ef18449396fb6542daaa5129" 875 | ] 876 | }, 877 | "outputId": "36dca186-1b05-4155-9815-c13546a5ad6f" 878 | }, 879 | "source": [ 880 | "\"\"\"FCN-ResNet101\"\"\"\n", 881 | "fcn = torch.hub.load('pytorch/vision:v0.6.0', 'fcn_resnet101', pretrained=True)\n", 882 | "fcn.eval()\n", 883 | "fcn_example = torch.rand(1, 3, 224, 224)\n", 884 | "fcn_traced_script_module = torch.jit.trace(fcn, fcn_example, strict=False)\n", 885 | "fcn_traced_script_module.save(\"fcn.pt\")" 886 | ], 887 | "execution_count": 5, 888 | "outputs": [ 889 | { 890 | "output_type": "stream", 891 | "text": [ 892 | "Downloading: \"https://github.com/pytorch/vision/archive/v0.6.0.zip\" to /root/.cache/torch/hub/v0.6.0.zip\n", 893 | "Downloading: \"https://download.pytorch.org/models/resnet101-5d3b4d8f.pth\" to /root/.cache/torch/hub/checkpoints/resnet101-5d3b4d8f.pth\n" 894 | ], 895 | "name": "stderr" 896 | }, 897 | { 898 | "output_type": "display_data", 899 | "data": { 900 | "application/vnd.jupyter.widget-view+json": { 901 | "model_id": "75ab0b7a6d804f93a574a0ba2ece1a50", 902 | "version_minor": 0, 903 | "version_major": 2 904 | }, 905 | "text/plain": [ 906 | "HBox(children=(FloatProgress(value=0.0, max=178728960.0), HTML(value='')))" 907 | ] 908 | }, 909 | "metadata": { 910 | "tags": [] 911 | } 912 | }, 913 | { 914 | "output_type": "stream", 915 | "text": [ 916 | "\n" 917 | ], 918 | "name": "stdout" 919 | }, 920 | { 921 | "output_type": "stream", 922 | "text": [ 923 | "Downloading: \"https://download.pytorch.org/models/fcn_resnet101_coco-7ecb50ca.pth\" to /root/.cache/torch/hub/checkpoints/fcn_resnet101_coco-7ecb50ca.pth\n" 924 | ], 925 | "name": "stderr" 926 | }, 927 | { 928 | "output_type": "display_data", 929 | "data": { 930 | "application/vnd.jupyter.widget-view+json": { 931 | "model_id": "fa14f81544254fa38418fd8df0586a73", 932 | "version_minor": 0, 933 | "version_major": 2 934 | }, 935 | "text/plain": [ 936 | "HBox(children=(FloatProgress(value=0.0, max=217800805.0), HTML(value='')))" 937 | ] 938 | }, 939 | "metadata": { 940 | "tags": [] 941 | } 942 | }, 943 | { 944 | "output_type": "stream", 945 | "text": [ 946 | "\n" 947 | ], 948 | "name": "stdout" 949 | } 950 | ] 951 | }, 952 | { 953 | "cell_type": "code", 954 | "metadata": { 955 | "id": "t_1MJ6FUnF_J", 956 | "colab_type": "code", 957 | "colab": { 958 | "base_uri": "https://localhost:8080/", 959 | "height": 120, 960 | "referenced_widgets": [ 961 | "1eca330d27a9430e85e5257b96be066b", 962 | "90cac4dfde3f46ac8594ed67ad0adf53", 963 | "de27b48e3ce0416da3bdb664e4db7b4f", 964 | "66aad7a4101b4734be990a31ee7dad00", 965 | "3bdcefab5b064cee9803d4a1d3e290f0", 966 | "7857076f048744cda1c8fe5222168296", 967 | "1278e6bc089c48b9bd1f08fc30b6eb5d", 968 | "4c50d1e036f3401d8cd92817ae0edb2b" 969 | ] 970 | }, 971 | "outputId": "f6aff1fc-afd0-4134-94a2-f98381751cfe" 972 | }, 973 | "source": [ 974 | "\"\"\"DeepLabV3-ResNet101\"\"\"\n", 975 | "deeplabv3 = torch.hub.load('pytorch/vision:v0.6.0', 'deeplabv3_resnet101', pretrained=True)\n", 976 | "deeplabv3.eval()\n", 977 | "deeplabv3_example = torch.rand(1, 3, 224, 224)\n", 978 | "deeplabv3_traced_script_module = torch.jit.trace(deeplabv3, deeplabv3_example, strict=False)\n", 979 | "deeplabv3_traced_script_module.save(\"deeplabv3.pt\")" 980 | ], 981 | "execution_count": 6, 982 | "outputs": [ 983 | { 984 | "output_type": "stream", 985 | "text": [ 986 | "Using cache found in /root/.cache/torch/hub/pytorch_vision_v0.6.0\n", 987 | "Downloading: \"https://download.pytorch.org/models/deeplabv3_resnet101_coco-586e9e4e.pth\" to /root/.cache/torch/hub/checkpoints/deeplabv3_resnet101_coco-586e9e4e.pth\n" 988 | ], 989 | "name": "stderr" 990 | }, 991 | { 992 | "output_type": "display_data", 993 | "data": { 994 | "application/vnd.jupyter.widget-view+json": { 995 | "model_id": "1eca330d27a9430e85e5257b96be066b", 996 | "version_minor": 0, 997 | "version_major": 2 998 | }, 999 | "text/plain": [ 1000 | "HBox(children=(FloatProgress(value=0.0, max=244545539.0), HTML(value='')))" 1001 | ] 1002 | }, 1003 | "metadata": { 1004 | "tags": [] 1005 | } 1006 | }, 1007 | { 1008 | "output_type": "stream", 1009 | "text": [ 1010 | "\n" 1011 | ], 1012 | "name": "stdout" 1013 | } 1014 | ] 1015 | } 1016 | ] 1017 | } --------------------------------------------------------------------------------