view json2yolosegment.xml @ 0:252fd085940d draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools commit 67e0e1d123bcfffb10bab8cc04ae67259caec557
author bgruening
date Fri, 13 Jun 2025 11:23:35 +0000
parents
children dfda27273ead
line wrap: on
line source

<tool id="json2yolosegment" name="Convert AnyLabeling JSON to YOLO text" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="24.2">
    <description>with ultralytics</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="creator" />
    <expand macro="edam" />
    <command detect_errors="aggressive">
    <![CDATA[
      mkdir ./input ./output &&

      #for $filename in $in_json:
          ln -s '$filename' './input/${filename.element_identifier}' &&
      #end for
		    
      python '$__tool_directory__/json2yolosegment.py' -i ./input/ -o ./output -c '$class_name'
		
    ]]>
    </command>
    <inputs>
	 <param name="in_json" type="data" format="json" multiple="true" label="Input label files" help="The label file is the output of AnyLabeling in JSON format."/>
         <param name="class_name" type="data" format="txt" label="Class file" help="Class names text file, contains the names of classes, one class per row."/>
    </inputs>
    <outputs>
        <collection name="output_yolo" type="list" label="YOLO text files">
		<discover_datasets pattern="(?P&lt;name&gt;.+)\.txt" visible="true" directory="./output" format="txt"/>
        </collection>
    </outputs>
    <tests>
        <test>
            <param name="in_json" value="in_json.json,in_json1.json" />
            <param name="class_name" value="class_names.txt" />
            <output_collection name="output_yolo">
                <element name="in_json">
                    <assert_contents>
                        <has_n_lines n="1" />
			<has_text text="0.8532289628180039" />
		    </assert_contents>
                </element>
	        <element name="in_json1">
                    <assert_contents>
		        <has_n_lines n="1" />
                        <has_text text="0.7710371819960861" />
		    </assert_contents>
                </element>
            </output_collection>
        </test>
    </tests>
    <help>
<![CDATA[
        **What it does**
        This tool converts label files generated by AnyLabeling into YOLO supported text files.
]]>
    </help>
    <expand macro="citations" />
</tool>