Object+Color Detection w/ Bounding Box Possible?

818 views
Skip to first unread message

Chase Maier

unread,
Apr 4, 2018, 2:23:21 AM4/4/18
to TensorFlow.js Discussion
Hi all,

New to the project, but it looks very interesting. I'm having a bit of trouble knowing where to get started though.

First of all, I was hoping someone would be able to confirm the capabilities of this library. A couple questions on that front:
  1. Can this be used for multiple object detection *within* an image -- producing bounding boxes for each matching item? I saw the example provided that detects numbers within an image but not sure if that would transfer the same way.
  2. Can different colors of the same objects be detected/distinguished separately?
  3. If these thing are possible, what type of training set size would be required?
    1. I currently have maybe, at most, 100 sample images (growing slightly over time). I would be able to extract from those specific examples of the objects that need detected and their bounding boxes. Is this a realistic number to make progress with or must it be substantially higher to even start?
  4. Once trained, I'd need to be able to: -- are these all possible?
    1. Use the model to detect specific colored lights in an image and get the bounding box around that light
    2. Run the detection quickly on a mobile browser (i.e. safari on ios)
The general idea is I want to detect colored lights in images, matching specific colors to specific lights: E.g. something like http://www.ledmuseum.net/eighth/bluray8.jpg

Is there some set of fairly specific instructions I could follow to at least investigate the feasibility of this? I didn't see a great starting point in any of the tutorials. Any guidance would be appreciated.

Thanks for any direction,
Chase

Stefan Vogel

unread,
Apr 6, 2018, 3:22:15 AM4/6/18
to TensorFlow.js Discussion
I would be interested in this, too.
I tried to started to try to convert the ssd-mobilenet_v1 from the tensorflow-objectdetection-model-zoo  https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md
but did not get this to work. Somehow the output-nodes detection_boxes, detection_scores were not found in the model.

Is it possible to do object-detection with tensorflowjs at all?

Nikhil Thorat

unread,
Apr 6, 2018, 1:36:47 PM4/6/18
to Stefan Vogel, TensorFlow.js Discussion, Ping Yu
What is the error you're getting when trying to port SSD? Can you paste the command you're running and the exact error?

There is no reason we can't support this, however you have have to do some post-processing work in JavaScript to convert Tensors to bounding boxes.

--
You received this message because you are subscribed to the Google Groups "TensorFlow.js Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tfjs+unsubscribe@tensorflow.org.
Visit this group at https://groups.google.com/a/tensorflow.org/group/tfjs/.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/3546ea01-6493-41f6-8426-b3520b791aa2%40tensorflow.org.

Stefan Vogel

unread,
Apr 8, 2018, 3:46:42 PM4/8/18
to TensorFlow.js Discussion, stefan.v...@gmail.com, pi...@google.com
Seems that I have the same problem as already mentioned in other threads.
I unzip ssd-mobilenet_v1 from the tensorflow-objectdetection-model-zoo  https://github.com/tensorflow/models/blob/master/research/object_detection/
and run:

tensorflowjs_converter --input_format tf_saved_model --output_node_names='detection_boxes' models\ssd_mobilenet_v1_coco_2017_11_17\saved_model some_existing_output_directory


and I get:
...
AssertionError: 'detection_boxes' is not in graph



Has someone successfully converted the object-detection-model zoo?
To unsubscribe from this group and stop receiving emails from it, send an email to tfjs+uns...@tensorflow.org.

Nikhil Thorat

unread,
Apr 10, 2018, 11:55:14 AM4/10/18
to Stefan Vogel, TensorFlow.js Discussion, Ping Yu
It's complaining because 'detection_boxes' isn't actually a node name in your graph. Are you sure that's the name of the output node name in SSD?

You can do this to list the node names:

[n.name for n in tf.get_default_graph().as_graph_def().node]


To unsubscribe from this group and stop receiving emails from it, send an email to tfjs+unsubscribe@tensorflow.org.

Shanqing Cai

unread,
Apr 11, 2018, 9:54:40 AM4/11/18
to TensorFlow.js Discussion, stefan.v...@gmail.com, pi...@google.com
Looks like that someone wrote an object detection app using tensorflow.js and tiny yolo (keras):

Reply all
Reply to author
Forward
Message has been deleted
0 new messages