forked from databricks/tensorframes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhw_tensorflow.sclpt
More file actions
31 lines (25 loc) · 954 Bytes
/
hw_tensorflow.sclpt
File metadata and controls
31 lines (25 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import $exec.DevDataSet, DevDataSet._
import $exec.DevTensorFlow, DevTensorFlow._
import TFOps.GraphFunction
val modelRoot = FPath.home / "local" / "data" / "tf_model"
// val iv3GFn = GraphFunction(
// modelRoot / "inception-v3" / "main.pb",
// Seq("input"), Seq("output"))
/**
* TensorFlow object detection library
*
* https://github.com/derekjchow/models/tree/master/object_detection
*/
val resnetGFn = GraphFunction(
modelRoot / "faster_rcnn_resnet101_coco_11_06_2017" / "frozen_inference_graph.pb",
Seq("image_tensor"),
Seq("detection_boxes", "detection_scores", "detection_classes", "num_detections"))
val nodes = resnetGFn.getNodeDict
val opTypes = nodes.map { _._2.getOp }.toSet
val placeholders = nodes.filter { case (name, node) =>
"Placeholder" == node.getOp
}
val imageInput = placeholders.head._2
val detections = nodes.filter { case (name, node) =>
name.startsWith("detection_") || name.endsWith("_detections")
}