This file contains 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
SET(CMAKE_SYSTEM_NAME Linux) | |
SET(CMAKE_SYSROOT /path/to/rootfs) | |
#debian dependencies required for building: | |
# libpthread-stubs0-dev_0.3-2_armel.deb | |
# libx11-6_1.3.3-4+squeeze1_armel.deb | |
# libx11-dev_1.3.3-4+squeeze1_armel.deb | |
# libxau-dev_1.0.6-1_armel.deb | |
# libxcb1_1.6-1+squeeze1_armel.deb |
This file contains 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
import os, argparse | |
import tensorflow as tf | |
from tensorflow.python.framework import graph_util | |
dir = os.path.dirname(os.path.realpath(__file__)) | |
def freeze_graph(model_folder, output_nodes='y_hat', | |
output_filename='frozen-graph.pb', | |
rename_outputs=None): |
This file contains 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 | |
if [ "$#" -ne 1 ]; then | |
echo "Usage download_dataset <path_to_save>" | |
exit 1 | |
fi | |
SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )" | |
TEMP_DIR=`mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir'` | |
echo $SCRIPT_PATH |
This file contains 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
<div> | |
<div style="position:relative;padding-top:56.25%"> | |
<iframe src="<youtube-embed-url-here" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen style="position:absolute;top:0;left:0;width:100%;height:100%;"></iframe> | |
</div> | |
</div> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
import streamlit as st | |
import cv2 | |
import tflite_runtime.interpreter as tflite | |
import numpy as np | |
import threading | |
from zipfile import ZipFile | |
BOX_COLOR = (0, 255, 255) #Yellow | |
TF_LITE_MODEL = './lite-model_ssd_mobilenet_v1_1_metadata_2.tflite' | |
CLASSES_OF_INTEREST = ['person', 'car', 'cat', 'dog'] |
This file contains 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
import threading | |
import numpy as np | |
import cv2 | |
class CameraThread(threading.Thread): | |
def __init__(self, name='CameraThread'): | |
super().__init__(name=name, daemon=True) | |
self.stop_event = False | |
self.open_camera() | |
self.setup_inference_engine() |
This file contains 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
import streamlit as st | |
#CameraThread is a sub-class of threading.Thread | |
@st.cache(allow_output_mutation=True) | |
def get_or_create_camera_thread(): | |
for th in threading.enumerate(): | |
if th.name == 'CameraThread': | |
th.stop() | |
th.join() | |
cw = CameraThread(name='CameraThread') |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>BackgroundColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMS | |
AAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVRyb290gAGjCwwTVSRudWxs0w0ODxAREldO | |
U1doaXRlXE5TQ29sb3JTcGFjZVYkY2xhc3NNMCAwLjg5OTk5OTk4ABADgALSFBUWF1ok | |
Y2xhc3NuYW1lWCRjbGFzc2VzV05TQ29sb3KiFhhYTlNPYmplY3QIERokKTI3SUxRU1dd |
This file contains 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
#!/bin/bash | |
count=0 | |
if [ $# -ne 2 ]; then | |
>&2 echo "Usage: $0 <input_file> <output_dir>" | |
>&2 echo "This script downloads all the tar files listed in the text file from https://ai.facebook.com/datasets/segment-anything-downloads/" | |
>&2 echo "To use this, accept the terms there, download the text file and run this script with it" | |
exit 1 | |
fi |