- Ubuntu 18.02
- Android NDK 20.0.5594570
- Protobuf v3.12.2
- Language C++ / Java
Use clang:
| # Built application files | |
| /*/build/ | |
| # Crashlytics configuations | |
| com_crashlytics_export_strings.xml | |
| # Local configuration file (sdk path, etc) | |
| local.properties | |
| # Gradle generated files |
$ bazel build -c opt \ --define MEDIAPIPE_DISABLE_GPU=1 \ --define no_aws_support=true \ mediapipe/examples/desktop/object_detection:object_detection_tensorflow and then `$ GLOG_logtostderr=1 bazel-bin/mediapipe/examples/desktop/object_detection/object_detection_tensorflow | from collections import deque # use to draw the last position line | |
| import numpy as np | |
| import argparse | |
| import imutils # helpful library (pyimagesearch.com) | |
| import cv2 | |
| from centroidtracker import CentroidTracker | |
| import time | |
| # construct argument parse input | |
| # ap = argparse.ArgumentParser() | |
| # ap.add_argument("-v", "--video", help="path to the (optional) video file") |
| //M1: exit and re-enter the application | |
| Intent mStartActivity = new Intent(this, MainActivity.class); | |
| int mPendingIntentId = 123456; | |
| PendingIntent mPendingIntent = PendingIntent.getActivity(this, mPendingIntentId, mStartActivity, PendingIntent.FLAG_CANCEL_CURRENT); | |
| AlarmManager mgr = (AlarmManager)this.getSystemService(Context.ALARM_SERVICE); | |
| mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, mPendingIntent); | |
| System.exit(0); | |
| //M2: let the current activity finish, app itself won't close | |
| Intent i = new Intent(this, MainActivity.class); |
Faster R-CNN for object detection
ResNet50/ResNet101: feature extractor(early layers for low-level features, later for high-level features.)
| #!/usr/bin/env python | |
| import sys | |
| import tensorflow as tf | |
| import numpy as np | |
| from tensorflow.examples.tutorials.mnist import input_data | |
| class Model(object): | |
| def __init__(self, x, with_new_layer=False): |
If you have a GPU, you shouldn't care about AVX support, because most expensive ops will be dispatched on a GPU device (unless explicitly set not to). In this case, you can simply ignore this warning by
# Just disables the warning, doesn't enable AVX/FMA
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
... or by setting export TF_CPP_MIN_LOG_LEVEL=2 if you're on Unix. Tensorflow is working fine anyway, but you won't see these annoying warnings.