changeset 26:17f0c9ef9da3 draft

Uploaded
author greg
date Thu, 19 Oct 2017 10:35:04 -0400
parents f8b16e55b18c
children b416787d41b0
files yolo.xml
diffstat 1 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/yolo.xml	Thu Oct 19 10:09:08 2017 -0400
+++ b/yolo.xml	Thu Oct 19 10:35:04 2017 -0400
@@ -4,26 +4,29 @@
         <requirement type="package" version="1.0">darknet</requirement>
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
-mkdir output_shape_confidence_dir &&
 mkdir input_dir &&
-mkdir output_png_dir &&
 cp -R /home/greg/_conda/envs/__darknet@1.0/bin/* .
 #set input = $input_type_cond.input
 #if str($input_type_cond.input_type) == 'image':
     #set input_filename = $input.file_name
     #set full_name = $input.name
     && ln -s $input_filename input_dir/$full_name
-    && darknet detect cfg/yolo.cfg yolo.weights 'input_dir/$full_name' -thresh $thresh > $output_shape_confidence
+    #if str($output_shape_confidence_log) == 'yes':
+        && darknet detect cfg/yolo.cfg yolo.weights 'input_dir/$full_name' -thresh $thresh 2> $output_shape_confidence
+    #else:
+        && darknet detect cfg/yolo.cfg yolo.weights 'input_dir/$full_name' -thresh $thresh 2> /dev/null
     && mv ./predictions.png $output_shape
 #else:
+    && mkdir output_shape_confidence_dir
+    && mkdir output_png_dir
     #for $i in $input:
         #set input_filename = $i.file_name
         #set full_name = $i.name
         #set head = $full_name.split('.')[0]
         #set output_filename_png = '%s_predictions.png' % $head
-        #set output_filename_shape_confidence = '%s_shape_detection_confidence.tabular' % $head
+        #set output_filename_shape_confidence = '%s_shape_detection_confidence.txt' % $head
         && ln -s $input_filename input_dir/$full_name
-        && darknet detect cfg/yolo.cfg yolo.weights 'input_dir/$full_name' -thresh $thresh > output_shape_confidence_dir/$output_filename_shape_confidence
+        && darknet detect cfg/yolo.cfg yolo.weights 'input_dir/$full_name' -thresh $thresh 2> output_shape_confidence_dir/$output_filename_shape_confidence
         && mv ./predictions.png output_png_dir/$output_filename_png
     #end for
 #end if
@@ -48,23 +51,28 @@
         </param>
     </inputs>
     <outputs>
-        <data name="output_shape_confidence" format="tabular" label="${tool.name} (shape detection confidence) on ${on_string}">
+        <data name="output_shape_confidence" format="txt" label="${tool.name} (shape detection confidence) on ${on_string}">
             <filter>input_type_cond['input_type'] == 'image' and output_shape_confidence_log == 'yes'</filter>
         </data>
         <data name="output_shape" format="png" label="${tool.name} (shapes) on ${on_string}">
             <filter>input_type_cond['input_type'] == 'image'</filter>
         </data>
         <collection name="output_shape_confidences" type="list" label="${tool.name} (shape detection confidence) on ${on_string}">
-            <discover_datasets pattern="__name__" directory="output_shape_confidence_dir" format="tabular" />
+            <discover_datasets pattern="__name__" directory="output_shape_confidence_dir" format="txt"/>
             <filter>input_type_cond['input_type'] == 'images' and output_shape_confidence_log == 'yes'</filter>
         </collection>
         <collection name="output_shapes" type="list" label="${tool.name} (shapes) on ${on_string}">
-            <discover_datasets pattern="__name__" directory="output_png_dir" format="png" />
+            <discover_datasets pattern="__name__" directory="output_png_dir" format="png"/>
             <filter>input_type_cond['input_type'] == 'images'</filter>
         </collection>
     </outputs>
     <tests>
         <test>
+        <test>
+            <param name="input" value="person_small.jpg" ftype="jpg"/>
+            <output name="output_shape_confidence" file="output_shape_confidence.txt" ftype="txt" compare="contains"/>
+            <output name="output_shape" file="output_shape1.jpg" ftype="jpg"/>
+        </test>
         </test>
     </tests>
     <help>