0
|
1 <tool id="yolo" name="YOLO" version="1.0">
|
|
2 <description>real-time object detection</description>
|
|
3 <requirements>
|
|
4 <requirement type="package" version="1.0">darknet</requirement>
|
|
5 </requirements>
|
|
6 <command detect_errors="exit_code"><![CDATA[
|
9
|
7 mkdir input_dir &&
|
18
|
8 cp -R /home/greg/_conda/envs/__darknet@1.0/bin/* .
|
25
|
9 #set input = $input_type_cond.input
|
23
|
10 #if str($input_type_cond.input_type) == 'image':
|
|
11 #set input_filename = $input.file_name
|
|
12 #set full_name = $input.name
|
18
|
13 && ln -s $input_filename input_dir/$full_name
|
26
|
14 #if str($output_shape_confidence_log) == 'yes':
|
|
15 && darknet detect cfg/yolo.cfg yolo.weights 'input_dir/$full_name' -thresh $thresh 2> $output_shape_confidence
|
|
16 #else:
|
|
17 && darknet detect cfg/yolo.cfg yolo.weights 'input_dir/$full_name' -thresh $thresh 2> /dev/null
|
24
|
18 && mv ./predictions.png $output_shape
|
23
|
19 #else:
|
26
|
20 && mkdir output_shape_confidence_dir
|
|
21 && mkdir output_png_dir
|
23
|
22 #for $i in $input:
|
|
23 #set input_filename = $i.file_name
|
|
24 #set full_name = $i.name
|
|
25 #set head = $full_name.split('.')[0]
|
|
26 #set output_filename_png = '%s_predictions.png' % $head
|
26
|
27 #set output_filename_shape_confidence = '%s_shape_detection_confidence.txt' % $head
|
23
|
28 && ln -s $input_filename input_dir/$full_name
|
26
|
29 && darknet detect cfg/yolo.cfg yolo.weights 'input_dir/$full_name' -thresh $thresh 2> output_shape_confidence_dir/$output_filename_shape_confidence
|
23
|
30 && mv ./predictions.png output_png_dir/$output_filename_png
|
|
31 #end for
|
|
32 #end if
|
0
|
33 ]]></command>
|
|
34 <inputs>
|
23
|
35 <conditional name="input_type_cond">
|
|
36 <param name="input_type" type="select" label="Select">
|
|
37 <option value="image" selected="true">a single image</option>
|
|
38 <option value="images">a collection of images</option>
|
|
39 </param>
|
|
40 <when value="image">
|
|
41 <param name="input" format="jpg" type="data" label="Image"/>
|
|
42 </when>
|
|
43 <when value="images">
|
|
44 <param name="input" format="jpg" type="data_collection" collection_type="list" label="Collection of image files"/>
|
|
45 </when>
|
|
46 </conditional>
|
|
47 <param name="thresh" type="float" value="0.25" label="Object detection threshold"/>
|
24
|
48 <param name="output_shape_confidence_log" type="select" display="radio" label="Output shape detection confidence levels?">
|
19
|
49 <option value="yes" selected="true">Yes</option>
|
|
50 <option value="no">No</option>
|
|
51 </param>
|
0
|
52 </inputs>
|
|
53 <outputs>
|
26
|
54 <data name="output_shape_confidence" format="txt" label="${tool.name} (shape detection confidence) on ${on_string}">
|
24
|
55 <filter>input_type_cond['input_type'] == 'image' and output_shape_confidence_log == 'yes'</filter>
|
23
|
56 </data>
|
|
57 <data name="output_shape" format="png" label="${tool.name} (shapes) on ${on_string}">
|
|
58 <filter>input_type_cond['input_type'] == 'image'</filter>
|
|
59 </data>
|
|
60 <collection name="output_shape_confidences" type="list" label="${tool.name} (shape detection confidence) on ${on_string}">
|
26
|
61 <discover_datasets pattern="__name__" directory="output_shape_confidence_dir" format="txt"/>
|
24
|
62 <filter>input_type_cond['input_type'] == 'images' and output_shape_confidence_log == 'yes'</filter>
|
8
|
63 </collection>
|
23
|
64 <collection name="output_shapes" type="list" label="${tool.name} (shapes) on ${on_string}">
|
26
|
65 <discover_datasets pattern="__name__" directory="output_png_dir" format="png"/>
|
23
|
66 <filter>input_type_cond['input_type'] == 'images'</filter>
|
21
|
67 </collection>
|
0
|
68 </outputs>
|
|
69 <tests>
|
|
70 <test>
|
26
|
71 <test>
|
|
72 <param name="input" value="person_small.jpg" ftype="jpg"/>
|
|
73 <output name="output_shape_confidence" file="output_shape_confidence.txt" ftype="txt" compare="contains"/>
|
|
74 <output name="output_shape" file="output_shape1.jpg" ftype="jpg"/>
|
|
75 </test>
|
0
|
76 </test>
|
|
77 </tests>
|
|
78 <help>
|
|
79 **What it does**
|
|
80
|
|
81 You only look once (YOLO) is a state-of-the-art, real-time object detection system.
|
|
82
|
|
83 -----
|
|
84
|
|
85 **Options**
|
|
86
|
|
87 </help>
|
|
88 <citations>
|
|
89 <citation type="bibtex">
|
|
90 @misc{darknet13,
|
|
91 author = {Joseph Redmon},
|
|
92 title = {Darknet: Open Source Neural Networks in C},
|
|
93 url = {http://pjreddie.com/darknet/},
|
|
94 year = {2013--2016}}
|
|
95 </citation>
|
|
96 <citation type="bibtex">
|
|
97 @article{redmon2016yolo9000,
|
|
98 title={YOLO9000: Better, Faster, Stronger},
|
|
99 author={Redmon, Joseph and Farhadi, Ali},
|
|
100 journal={arXiv preprint arXiv:1612.08242},
|
|
101 year={2016}}
|
|
102 </citation>
|
|
103 </citations>
|
|
104 </tool>
|