|
| 1 | +# Copyright 2016 Google, Inc |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in write, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +require_relative "label_detection" |
| 16 | +require_relative "landmark_detection" |
| 17 | +require_relative "face_detection" |
| 18 | + |
| 19 | +detection_type = ARGV.shift |
| 20 | +path_to_image_file = ARGV.shift |
| 21 | +path_to_output_file = ARGV.shift |
| 22 | + |
| 23 | +case detection_type |
| 24 | +when "label" |
| 25 | + detect_labels path_to_image_file |
| 26 | +when "landmark" |
| 27 | + detect_landmark path_to_image_file |
| 28 | +when "faces" |
| 29 | + detect_faces path_to_image_file, path_to_output_file |
| 30 | +else |
| 31 | + puts "Usage: detect.rb [type] [image path] [output path]" |
| 32 | + puts |
| 33 | + puts " detect.rb label /path/to/image.jpg" |
| 34 | + puts " detect.rb landmark /path/to/image.jpg" |
| 35 | + puts " detect.rb faces /path/to/image.jpg /path/to/output.jpg" |
| 36 | +end |
0 commit comments