Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Commit

Permalink
Add CLI guide
Browse files Browse the repository at this point in the history
  • Loading branch information
PolinaSavelyeva committed Sep 12, 2023
1 parent 7ca11eb commit 459e1c9
Show file tree
Hide file tree
Showing 5 changed files with 197 additions and 10 deletions.
92 changes: 92 additions & 0 deletions docs/How_Tos/Doing_Another_Thing.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,98 @@
<div class="container" id="fsdocs-content">

<h1><a name="How-To-use-CLI" class="anchor" href="#How-To-use-CLI">How-To use CLI</a></h1>
<h2><a name="Overview" class="anchor" href="#Overview">Overview</a></h2>
<hr />
<p>The CLI accepts several command-line arguments that control the behavior of the image processing application.
Below is a list of available command-line arguments and their descriptions.</p>
<h3><a name="InputPath" class="anchor" href="#InputPath">InputPath</a></h3>
<ul>
<li><strong>Syntax:</strong> <code>-in &lt;inputPath&gt;</code></li>
<li><strong>Description:</strong> Specifies the path to a file or directory where the images to be processed are located.</li>
</ul>
<h3><a name="OutputPath" class="anchor" href="#OutputPath">OutputPath</a></h3>
<ul>
<li><strong>Syntax:</strong> <code>-out &lt;outputPath&gt;</code></li>
<li><strong>Description:</strong> Specifies the path to a file or directory where the processed images will be saved.</li>
</ul>
<h3><a name="AgentsSupport" class="anchor" href="#AgentsSupport">AgentsSupport</a></h3>
<ul>
<li><strong>Syntax:</strong> <code>-agent=&lt;agentType&gt;</code></li>
<li>
<strong>Description:</strong> Allows you to specify the <a href="https://polinasavelyeva.github.io/ImageProcessing/reference/process-agentssupport.html">agent strategy</a> to be used during image processing. You can choose from the following options:
<ul>
<li><code>Full</code>, which uses a single agent for opening, processing and saving</li>
<li><code>Partial</code>, which uses different agents for each transformation and saving</li>
<li><code>PartialUsingComposition</code>, which uses one agent for transformation and one for saving</li>
<li><code>No</code>, which uses naive image processing function</li>
</ul>
</li>
</ul>
<h3><a name="ProcessingUnit" class="anchor" href="#ProcessingUnit">ProcessingUnit</a></h3>
<ul>
<li><strong>Syntax:</strong> <code>-unit=&lt;unitType&gt;</code></li>
<li>
<strong>Description:</strong> Specifies the <a href="https://polinasavelyeva.github.io/ImageProcessing/reference/process-processingunits.html">processing unit</a> to be used for image processing. You can choose from the following options:
<ul>
<li><code>CPU</code></li>
<li><code>NvidiaGPU</code></li>
<li><code>IntelGPU</code></li>
<li><code>AmdGPU</code></li>
<li><code>AnyGPU</code></li>
</ul>
</li>
</ul>
<h3><a name="Transformations" class="anchor" href="#Transformations">Transformations</a></h3>
<ul>
<li><strong>Syntax:</strong> <code>&lt;transformation1&gt; &lt;transformation2&gt; ...</code></li>
<li>
<strong>Description:</strong> Provides a list of <a href="https://polinasavelyeva.github.io/ImageProcessing/reference/process-transformations.html">available transformations</a> to be applied during image processing. You can choose from the following options:
<ul>
<li><code>Gauss</code></li>
<li><code>Sharpen</code></li>
<li><code>Lighten</code></li>
<li><code>Darken</code></li>
<li><code>Edges</code></li>
<li><code>RotationR</code></li>
<li><code>RotationL</code></li>
<li><code>FlipV</code></li>
<li><code>FlipH</code></li>
</ul>
</li>
</ul>
<h2><a name="Usage" class="anchor" href="#Usage">Usage</a></h2>
<hr />
<p>Before usage, go to specify directory:</p>
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">cd /path/to/ImageProcessing/src/ImageProcessing
</code></pre></td></tr></table>
<p>To process images from one directory and save them to another, you can use the following commands.</p>
<ul>
<li><strong>Оne transformation applied to each image in the directory</strong></li>
</ul>
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">dotnet run -in /input/path -out /output/path -agent=full -unit=cpu gauss
</code></pre></td></tr></table>
<ul>
<li><strong>List of transformations that are sequentially applied</strong></li>
</ul>
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">dotnet run -in /input/path -out /output/path -agent=no -unit=anygpu gauss sharpen
</code></pre></td></tr></table>
<h2><a name="Examples" class="anchor" href="#Examples">Examples</a></h2>
<hr />
<p>Before usage, go to specify directory:</p>
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">cd /path/to/ImageProcessing/src/ImageProcessing
</code></pre></td></tr></table>
<ol>
<li>
<p>Process images using the CPU with Gauss filter:</p>
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">dotnet run -in "input_directory" -out "output_directory" -unit=cpu gauss
</code></pre></td></tr></table>
</li>
<li>
<p>Process images using an Nvidia GPU with full agent support and rotations:</p>
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">dotnet run -in "input_directory" -out "output_directory" -unit=NvidiaGPU -agent=Full -rotationl -rotationr
</code></pre></td></tr></table>
</li>
</ol>


</div>
Expand Down
8 changes: 4 additions & 4 deletions docs/Tutorials/Getting_Started.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ <h3><a name="Requirements" class="anchor" href="#Requirements">Requirements</a><
<p>To find more building and running options take a look at the <a href="https://github.com/TheAngryByrd/MiniScaffold">MiniScaffold</a> template.</p>
<h3><a name="Package-Adding" class="anchor" href="#Package-Adding">Package Adding</a></h3>
<p>Go to directory with your <code>build.fsproj</code> (or <code>build.csproj</code>) file and install ImageProcessing using command line:</p>
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="bash">dotnet add package ImageProcessing --version 1.0.0
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="shell">dotnet add package ImageProcessing --version 1.0.0
</code></pre></td></tr></table>
<p>For more information visit package main <a href="https://github.com/PolinaSavelyeva/ImageProcessing/pkgs/nuget/ImageProcessing">GitHub page</a>.</p>
<h2><a name="Features" class="anchor" href="#Features">Features</a></h2>
Expand Down Expand Up @@ -202,18 +202,18 @@ <h2><a name="Simple-Usage" class="anchor" href="#Simple-Usage">Simple Usage</a><
<hr />
<h3><a name="Using-CLI" class="anchor" href="#Using-CLI">Using CLI</a></h3>
<p>Before usage, go to specify directory:</p>
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">$ cd /path/to/ImageProcessing/src/ImageProcessing
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">cd /path/to/ImageProcessing/src/ImageProcessing
</code></pre></td></tr></table>
<p>To process images from one directory and save them to another, you can use the following commands.</p>
<ul>
<li><strong>Оne transformation applied to each image in the directory</strong></li>
</ul>
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">$ dotnet run -in /input/path -out /output/path -agent=full -unit=cpu gauss
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">dotnet run -in /input/path -out /output/path -agent=full -unit=cpu gauss
</code></pre></td></tr></table>
<ul>
<li><strong>List of transformations that are sequentially applied</strong></li>
</ul>
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">$ dotnet run -in /input/path -out /output/path -agent=no -unit=anygpu gauss sharpen
<table class="pre"><tr><td class="snippet"><pre class="fssnip"><code lang="sh">dotnet run -in /input/path -out /output/path -agent=no -unit=anygpu gauss sharpen
</code></pre></td></tr></table>
<p>More details about CLI processing you can find <a href="https://polinasavelyeva.github.io/ImageProcessing/How_Tos/Doing_Another_Thing.html">here</a>.</p>
<h3><a name="Using-Your-Own-Code" class="anchor" href="#Using-Your-Own-Code">Using Your Own Code</a></h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.json

Large diffs are not rendered by default.

94 changes: 94 additions & 0 deletions docsSrc/How_Tos/Doing_Another_Thing.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,97 @@ index: 2

# How-To use CLI

## Overview

---

The CLI accepts several command-line arguments that control the behavior of the image processing application.
Below is a list of available command-line arguments and their descriptions.

### InputPath

* **Syntax:** `-in <inputPath>`
* **Description:** Specifies the path to a file or directory where the images to be processed are located.

### OutputPath

* **Syntax:** `-out <outputPath>`
* **Description:** Specifies the path to a file or directory where the processed images will be saved.

### AgentsSupport

* **Syntax:** `-agent=<agentType>`
* **Description:** Allows you to specify the [agent strategy](https://polinasavelyeva.github.io/ImageProcessing/reference/process-agentssupport.html) to be used during image processing. You can choose from the following options:
* ``Full``, which uses a single agent for opening, processing and saving
* ``Partial``, which uses different agents for each transformation and saving
* ``PartialUsingComposition``, which uses one agent for transformation and one for saving
* ``No``, which uses naive image processing function

### ProcessingUnit

* **Syntax:** `-unit=<unitType>`
* **Description:** Specifies the [processing unit](https://polinasavelyeva.github.io/ImageProcessing/reference/process-processingunits.html) to be used for image processing. You can choose from the following options:
* ``CPU``
* ``NvidiaGPU``
* ``IntelGPU``
* ``AmdGPU``
* ``AnyGPU``

### Transformations

- **Syntax:** `<transformation1> <transformation2> ...`
- **Description:** Provides a list of [available transformations](https://polinasavelyeva.github.io/ImageProcessing/reference/process-transformations.html) to be applied during image processing. You can choose from the following options:
* ``Gauss``
* ``Sharpen``
* ``Lighten``
* ``Darken``
* ``Edges``
* ``RotationR``
* ``RotationL``
* ``FlipV``
* ``FlipH``

## Usage

---

Before usage, go to specify directory:

```sh
cd /path/to/ImageProcessing/src/ImageProcessing
```

To process images from one directory and save them to another, you can use the following commands.

* **Оne transformation applied to each image in the directory**

```sh
dotnet run -in /input/path -out /output/path -agent=full -unit=cpu gauss
```

* **List of transformations that are sequentially applied**

```sh
dotnet run -in /input/path -out /output/path -agent=no -unit=anygpu gauss sharpen
```

## Examples

---

Before usage, go to specify directory:

```sh
cd /path/to/ImageProcessing/src/ImageProcessing
```

1. Process images using the CPU with Gauss filter:
```sh
dotnet run -in "input_directory" -out "output_directory" -unit=cpu gauss
```

2. Process images using an Nvidia GPU with full agent support and rotations:
```sh
dotnet run -in "input_directory" -out "output_directory" -unit=NvidiaGPU -agent=Full -rotationl -rotationr
```

11 changes: 6 additions & 5 deletions docsSrc/Tutorials/Getting_Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ To find more building and running options take a look at the [MiniScaffold](http

Go to directory with your ``build.fsproj`` (or ``build.csproj``) file and install ImageProcessing using command line:

[lang=bash]
dotnet add package ImageProcessing --version 1.0.0
```shell
dotnet add package ImageProcessing --version 1.0.0
```

For more information visit package main [GitHub page](https://github.com/PolinaSavelyeva/ImageProcessing/pkgs/nuget/ImageProcessing).

Expand Down Expand Up @@ -72,20 +73,20 @@ For detailed descriptions of all features above visit [Api Reference](https://po
Before usage, go to specify directory:

```sh
$ cd /path/to/ImageProcessing/src/ImageProcessing
cd /path/to/ImageProcessing/src/ImageProcessing
```
To process images from one directory and save them to another, you can use the following commands.

* **Оne transformation applied to each image in the directory**

```sh
$ dotnet run -in /input/path -out /output/path -agent=full -unit=cpu gauss
dotnet run -in /input/path -out /output/path -agent=full -unit=cpu gauss
```

* **List of transformations that are sequentially applied**

```sh
$ dotnet run -in /input/path -out /output/path -agent=no -unit=anygpu gauss sharpen
dotnet run -in /input/path -out /output/path -agent=no -unit=anygpu gauss sharpen
```

More details about CLI processing you can find [here](https://polinasavelyeva.github.io/ImageProcessing/How_Tos/Doing_Another_Thing.html).
Expand Down

0 comments on commit 459e1c9

Please sign in to comment.