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[
|
19
|
7 mkdir output_shape_confidence_dir &&
|
9
|
8 mkdir input_dir &&
|
19
|
9 mkdir output_png_dir &&
|
18
|
10 cp -R /home/greg/_conda/envs/__darknet@1.0/bin/* .
|
23
|
11 #set input $input_type_cond.input
|
|
12 #if str($input_type_cond.input_type) == 'image':
|
|
13 #set input_filename = $input.file_name
|
|
14 #set full_name = $input.name
|
15
|
15 #set head = $full_name.split('.')[0]
|
22
|
16 #set output_filename_png = '%s_predictions.png' % $head
|
19
|
17 #set output_filename_shape_confidence = '%s_shape_detection_confidence.tabular' % $head
|
18
|
18 && ln -s $input_filename input_dir/$full_name
|
22
|
19 && darknet detect cfg/yolo.cfg yolo.weights 'input_dir/$full_name' -thresh $thresh > output_shape_confidence_dir/$output_filename_shape_confidence
|
|
20 && mv ./predictions.png output_png_dir/$output_filename_png
|
23
|
21 #else:
|
|
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
|
|
27 #set output_filename_shape_confidence = '%s_shape_detection_confidence.tabular' % $head
|
|
28 && ln -s $input_filename input_dir/$full_name
|
|
29 && darknet detect cfg/yolo.cfg yolo.weights 'input_dir/$full_name' -thresh $thresh > output_shape_confidence_dir/$output_filename_shape_confidence
|
|
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"/>
|
19
|
48 <param name="output_shape_confidence" type="select" display="radio" label="Output shape detection confidence levels?">
|
|
49 <option value="yes" selected="true">Yes</option>
|
|
50 <option value="no">No</option>
|
|
51 </param>
|
0
|
52 </inputs>
|
|
53 <outputs>
|
23
|
54 <data name="output_shape_confidence" format="tabular" label="${tool.name} (shape detection confidence) on ${on_string}">
|
|
55 <filter>input_type_cond['input_type'] == 'image' and output_shape_confidence == 'yes'</filter>
|
|
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}">
|
19
|
61 <discover_datasets pattern="__name__" directory="output_shape_confidence_dir" format="tabular" />
|
23
|
62 <filter>input_type_cond['input_type'] == 'images' and output_shape_confidence == 'yes'</filter>
|
8
|
63 </collection>
|
23
|
64 <collection name="output_shapes" type="list" label="${tool.name} (shapes) on ${on_string}">
|
21
|
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>
|
|
71 </test>
|
|
72 </tests>
|
|
73 <help>
|
|
74 **What it does**
|
|
75
|
|
76 You only look once (YOLO) is a state-of-the-art, real-time object detection system.
|
|
77
|
|
78 -----
|
|
79
|
|
80 **Options**
|
|
81
|
|
82 </help>
|
|
83 <citations>
|
|
84 <citation type="bibtex">
|
|
85 @misc{darknet13,
|
|
86 author = {Joseph Redmon},
|
|
87 title = {Darknet: Open Source Neural Networks in C},
|
|
88 url = {http://pjreddie.com/darknet/},
|
|
89 year = {2013--2016}}
|
|
90 </citation>
|
|
91 <citation type="bibtex">
|
|
92 @article{redmon2016yolo9000,
|
|
93 title={YOLO9000: Better, Faster, Stronger},
|
|
94 author={Redmon, Joseph and Farhadi, Ali},
|
|
95 journal={arXiv preprint arXiv:1612.08242},
|
|
96 year={2016}}
|
|
97 </citation>
|
|
98 </citations>
|
|
99 </tool>
|