comparison pytorch_embedding.xml @ 0:38333676a029 draft default tip

planemo upload for repository https://github.com/goeckslab/gleam.git commit f57ec1ad637e8299db265ee08be0fa9d4d829b93
author goeckslab
date Thu, 19 Jun 2025 23:33:23 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:38333676a029
1 <tool id="extract_embeddings" name="Image Embedding Extraction" version="1.0.0">
2 <description>Extract image embeddings using a deep learning model</description>
3
4 <requirements>
5 <container type="docker">quay.io/goeckslab/galaxy-ludwig-gpu:0.10.1</container>
6 </requirements>
7 <stdio>
8 <exit_code range="137" level="fatal_oom" description="Out of Memory" />
9 <exit_code range="1:" level="fatal" description="Error occurred. Please check Tool Standard Error" />
10 </stdio>
11 <command><![CDATA[
12 mkdir -p "./hf_cache" &&
13 export HF_HOME="./hf_cache" &&
14 export TORCH_HOME="./hf_cache" &&
15 python $__tool_directory__/pytorch_embedding.py
16 --zip_file "$input_zip"
17 --output_csv "$output_csv"
18 --model_name "$model_name"
19 #if $apply_normalization
20 --normalize
21 #end if
22 #if $ludwig_format
23 --ludwig_format
24 #end if
25 --transform_type "$transform_type"
26 ]]></command>
27 <configfiles>
28 <inputs name="inputs" />
29 </configfiles>
30 <inputs>
31 <param argument="input_zip" type="data" format="zip" label="Input Zip File (Images)" help="Provide a zip file containing images to process." />
32 <param argument="model_name" type="select" label="Model for Embedding Extraction" help="Select the model to use for embedding extraction.">
33 <option value="alexnet">AlexNet</option>
34 <option value="convnext_tiny">ConvNeXt-Tiny</option>
35 <option value="convnext_small">ConvNeXt-Small</option>
36 <option value="convnext_base">ConvNeXt-Base</option>
37 <option value="convnext_large">ConvNeXt-Large</option>
38 <option value="densenet121">DenseNet121</option>
39 <option value="densenet161">DenseNet161</option>
40 <option value="densenet169">DenseNet169</option>
41 <option value="densenet201">DenseNet201</option>
42 <option value="efficientnet_b0" >EfficientNet-B0</option>
43 <option value="efficientnet_b1">EfficientNet-B1</option>
44 <option value="efficientnet_b2">EfficientNet-B2</option>
45 <option value="efficientnet_b3">EfficientNet-B3</option>
46 <option value="efficientnet_b4">EfficientNet-B4</option>
47 <option value="efficientnet_b5">EfficientNet-B5</option>
48 <option value="efficientnet_b6">EfficientNet-B6</option>
49 <option value="efficientnet_b7">EfficientNet-B7</option>
50 <option value="efficientnet_v2_s">EfficientNetV2-S</option>
51 <option value="efficientnet_v2_m">EfficientNetV2-M</option>
52 <option value="efficientnet_v2_l">EfficientNetV2-L</option>
53 <option value="googlenet">GoogLeNet</option>
54 <option value="inception_v3">Inception-V3</option>
55 <option value="mnasnet0_5">MNASNet-0.5</option>
56 <option value="mnasnet0_75">MNASNet-0.75</option>
57 <option value="mnasnet1_0">MNASNet-1.0</option>
58 <option value="mnasnet1_3">MNASNet-1.3</option>
59 <option value="mobilenet_v2">MobileNetV2</option>
60 <option value="mobilenet_v3_large">MobileNetV3-Large</option>
61 <option value="mobilenet_v3_small">MobileNetV3-Small</option>
62 <option value="regnet_x_400mf">RegNet-X-400MF</option>
63 <option value="regnet_x_800mf">RegNet-X-800MF</option>
64 <option value="regnet_x_1_6gf">RegNet-X-1.6GF</option>
65 <option value="regnet_x_3_2gf">RegNet-X-3.2GF</option>
66 <option value="regnet_x_8gf">RegNet-X-8GF</option>
67 <option value="resnet18">ResNet-18</option>
68 <option value="resnet34">ResNet-34</option>
69 <option value="resnet50" selected="true">ResNet-50</option>
70 <option value="resnet101">ResNet-101</option>
71 <option value="resnet152">ResNet-152</option>
72 <option value="resnext50_32x4d">ResNeXt-50-32x4d</option>
73 <option value="resnext101_32x8d">ResNeXt-101-32x8d</option>
74 <option value="shufflenet_v2_x0_5">ShuffleNetV2-0.5x</option>
75 <option value="shufflenet_v2_x1_0">ShuffleNetV2-1.0x</option>
76 <option value="squeezenet1_0">SqueezeNet1.0</option>
77 <option value="squeezenet1_1">SqueezeNet1.1</option>
78 <option value="swin_b">Swin-B</option>
79 <option value="swin_s">Swin-S</option>
80 <option value="swin_t">Swin-T</option>
81 <option value="vgg11">VGG-11</option>
82 <option value="vgg13">VGG-13</option>
83 <option value="vgg16">VGG-16</option>
84 <option value="vgg19">VGG-19</option>
85 <option value="vit_b_16">ViT-B-16</option>
86 <option value="vit_b_32">ViT-B-32</option>
87 <option value="wide_resnet50_2">Wide-ResNet50-2</option>
88 <option value="wide_resnet101_2">Wide-ResNet101-2</option>
89 </param>
90 <param argument="apply_normalization" type="boolean" label="Apply Normalization" help="Enable or disable normalization of embeddings." checked="true"/>
91 <param argument="transform_type" type="select" label="Image Transformation Type" help="Choose the transformation type to apply before extraction.">
92 <option value="RGB" selected="true">RGB</option>
93 <option value="grayscale">Grayscale</option>
94 <option value="rgba_to_rgb">RGBA to RGB</option>
95 <option value="clahe">CLAHE (Contrast Limited Adaptive Histogram Equalization)</option>
96 <option value="edges">Edge Detection</option>
97 </param>
98 <param name="ludwig_format" type="boolean" optional="true" label="Convert vectors (stored as columns) into a single string column (Ludwig Format)?"/>
99 </inputs>
100 <outputs>
101 <data name="output_csv" format="csv" label="Extracted Embeddings" />
102 </outputs>
103
104 <tests>
105 <test>
106 <param name="input_zip" value="1_digit.zip" ftype="zip" />
107 <param name="model_name" value="resnet50" />
108 <param name="apply_normalization" value="true" />
109 <param name="transform_type" value="RGB" />
110 <output name="output_csv">
111 <assert_contents>
112 <has_text text="sample_name" />
113 <has_n_columns min="1" />
114 </assert_contents>
115 </output>
116 </test>
117 </tests>
118 <help>
119 <![CDATA[
120 **What it does**
121 This tool extracts image embeddings using a selected deep learning model.
122
123 **Inputs**
124 - A zip file containing images to process.
125 - A model selection for embedding extraction.
126 - An option to apply normalization to the extracted embeddings.
127 - A choice of image transformation type before processing.
128
129 **Outputs**
130 - A CSV file containing embeddings. Each row corresponds to an image, with the file name in the first column and embedding vectors in the subsequent columns.
131 ]]>
132 </help>
133 </tool>