# Install AVD files
yes | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-29;default;x86'
yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses
# Create emulator
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_API_29_AOSP -d pixel --package 'system-images;android-29;default;x86' --force
$ANDROID_HOME/emulator/emulator -list-avds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server: | |
port: 8080 | |
shutdown: graceful | |
undertow: | |
threads: | |
worker: 24 | |
io: 3 | |
error: | |
whitelabel: | |
enabled: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tf = require('@tensorflow/tfjs-node'); | |
const Jimp = require('jimp'); | |
// Directory path for model files (model.json, metadata.json, weights.bin) | |
// NOTE: It can be obtained from [Export Model] -> [Tensorflow.js] -> [Download my model] | |
// on https://teachablemachine.withgoogle.com/train/image | |
const MODEL_DIR_PATH = `${__dirname}`; | |
// Path for image file to predict class | |
const IMAGE_FILE_PATH = `${__dirname}/example.jpg`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Having a requirements.txt file has follows | |
torch==1.5.0 | |
numpy==1.18.1 | |
# Add channels. Last added is with the highest priorety | |
conda config --add channels pytorch | |
conda config --add channels conda-forge | |
conda config --add channels anaconda | |
# Install pip for fallback |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install bert-for-tf2 | |
pip install bert-tokenizer | |
pip install tensorflow-hub | |
pip install bert-tensorflow | |
pip install sentencepiece | |
import tensorflow_hub as hub | |
import tensorflow as tf | |
import bert |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Kedro Torch Model IO | |
Models need to be imported and added to the dictionary | |
as shown with the ExampleModel | |
Example of catalog entry: | |
modo: | |
type: kedro_example.io.torch_model.TorchLocalModel | |
filepath: modo.pt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
### Bash Environment Setup | |
# http://redsymbol.net/articles/unofficial-bash-strict-mode/ | |
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html | |
# set -o xtrace | |
set -o errexit | |
set -o errtrace | |
set -o nounset | |
set -o pipefail |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' ExportModel.py - TF-Serving | |
# Basically we are wrapping your pretrained model | |
# in a tensorflow serving compatible format. | |
# This excepts base64 encoded png images and uses | |
# them as input to your model. Then we convert | |
# your models output into a png encoded image and | |
# it gets returned by tensorflow serving base64 encoded. | |
''' | |
import tensorflow as tf |
For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):
-
List All System Images Available for Download:
sdkmanager --list | grep system-images
-
Download Image:
sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a Singularity image from a Docker image that is in the Docker hub | |
// where /tmp/ is the folder where the image will be created and ubuntu:14.04 | |
// is the docker image used to convert to the Singularity image | |
docker run \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
-v /tmp/:/output \ | |
--privileged -t --rm \ | |
singularityware/docker2singularity \ | |
ubuntu:14.04 | |
// |
NewerOlder