Skip to content

Instantly share code, notes, and snippets.

@achristianson
Created March 5, 2018 14:04
Show Gist options
  • Save achristianson/1dea217e5fcbc88b87e526d919dad2c0 to your computer and use it in GitHub Desktop.
Save achristianson/1dea217e5fcbc88b87e526d919dad2c0 to your computer and use it in GitHub Desktop.
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the \"License\"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an \"AS IS\" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Flow Controller:
name: MiNiFi Flow
Processors:
- name: Get
class: GetUSBCamera
Properties:
FPS: .5
Format: RAW
USB Vendor ID: 0x045e
USB Product ID: 0x0779
- name: GraphGet
class: GetFile
scheduling strategy: TIMER_DRIVEN
scheduling period: 120 sec
Properties:
Keep Source File: true
Input Directory: conf/nasnet-a
File Filter: ".*pb$"
- name: GraphUpdate
class: UpdateAttribute
Properties:
tf.type: graph
- name: LabelsGet
class: GetFile
scheduling strategy: TIMER_DRIVEN
scheduling period: 120 sec
Properties:
Keep Source File: true
Input Directory: conf/nasnet-a
File Filter: "labels.txt"
- name: LabelsUpdate
class: UpdateAttribute
Properties:
tf.type: labels
- name: Convert
class: TFConvertImageToTensor
Properties:
Input Format: RAW
Input Width: 1280
Input Height: 800
Crop Offset X: 240
Crop Offset Y: 0
Crop Size X: 800
Crop Size Y: 800
Output Width: 331
Output Height: 331
Channels: 3
- name: Apply
class: TFApplyGraph
Properties:
Input Node: input:0
Output Node: final_layer/predictions:0
- name: Extract
class: TFExtractTopLabels
- name: Log
class: LogAttribute
- name: Route
class: RouteOnAttribute
Properties:
cat: ${"tf.top_label_0":matches('(282|283|284|285|286|287|288|289|290|291|292|293|294):.*')}
auto-terminated relationships list:
- unmatched
- name: Notify
class: ExecuteProcess
Properties:
Command: notify-send CAT_DETECTED
auto-terminated relationships list:
- success
Connections:
- source name: Get
source relationship name: success
destination name: Convert
- source name: GraphGet
source relationship name: success
destination name: GraphUpdate
- source name: GraphUpdate
source relationship name: success
destination name: Apply
- source name: LabelsGet
source relationship name: success
destination name: LabelsUpdate
- source name: LabelsUpdate
source relationship name: success
destination name: Extract
- source name: Convert
source relationship name: success
destination name: Apply
- source name: Apply
source relationship name: success
destination name: Extract
- source name: Extract
source relationship name: success
destination name: Log
- source name: Log
source relationship name: success
destination name: Route
- source name: Route
source relationship name: cat
destination name: Notify
Remote Processing Groups: []
Provenance Reporting:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment