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