Skip to content

Commit

Permalink
Add docs clarifications and updates (#140)
Browse files Browse the repository at this point in the history
* Update dev packages, lint files

* Remove some pre-commit checks

* Add some docs clarifications
  • Loading branch information
tayden authored Feb 7, 2025
1 parent 3ec43de commit 7c1a0dc
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 19 deletions.
22 changes: 21 additions & 1 deletion docs/beginner_guide/execution.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Running the Segmentation Tool
# Processing Images with Kelp-O-Matic

Each time you want to run a classification on new imagery follow these steps.

Expand Down Expand Up @@ -109,6 +109,26 @@ Once you have constructed your command, execute it by pressing ++enter++.
Wait for the progress bar to reach 100%, then open the results in an image processing or spatial analysis software such as QGIS or ArcGIS.
Review the results for errors and edit as needed.

??? tip "Checking GPU Usage"

If you have a GPU, you should be able to run `nvidia-smi` to check its status.
You can see here what processes are using the GPU, and how much memory they are using.

If Kelp-O-Matic is running, you'll have to run this in a new Poweshell window or tab.
If Kelp-O-Matic is actively using the GPU, you should see it listed here.

#### Aborting Processing

If you need to stop the processing of an image, you can press ++ctrl+c++ in the terminal to send a signal to the process
that it should stop. This will stop the processing and return you to the command prompt.

This is useful, for example, if you realize that you entered the wrong path and need to correct it but don't want to
wait for `kom` for finish running.

This command is standard in the terminal. It is used to send a signal to the running process that it should stop.

---

**Part 3 Kelp Segmentation is now complete!**

Continue to [Part 4](./post_processing.md) to learn how to post-process the results.
60 changes: 48 additions & 12 deletions docs/beginner_guide/install_env_setup.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
# Virtual Environment Setup and Installation
# Environment Setup and Installation

It is recommended to install Kelp-O-Matic in a virtual environment to avoid conflicts
with other Python packages present on your system. `uv` is our recommended environment manager, so we'll use it in this
guide.

??? question "Why UV"
??? question "Why UV?"

`uv` is a Python environment manager that is easy to use and works on Windows, MacOS, and Linux.
It is a good choice for beginners and experienced users alike. It's extremely fast and lightweight, and provides a
simple way to manage Python environments and install packages.

## UV Virtual Environment Setup

1. Install `uv` using their [installation instructions](https://docs.astral.sh/uv/getting-started/installation/).
1. This will make a new command available in your terminal called `uv`.
2. Check the official instructions for installation, but generally, you're going to copy and paste the installation
command they provide (e.g. `curl ...`) into your terminal and press ++enter++. Read and follow the instructions
and prompts that are printed.
1. Install `uv` using their [Standalone installer instructions](https://docs.astral.sh/uv/getting-started/installation/).
1. At the time of writing these docs, the command to run is:

2. Once UV is installed, create a new "virtual environment" in your preferred location with the following commands:
=== "Windows"
```powershell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```
=== "MacOS/Linux"
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```

2. Once you copy and paste the command into your terminal, press ++enter++. Read and follow the instructions
and prompts.
3. Once installation is finished, you will have a new terminal command: `uv`.

2. Use to create a new "virtual environment" in your preferred file system location with the following commands:
```bash
cd path/to/your/preferred/location
uv venv my_env_name # my_env_name is the name of your virtual environment. You can choose any name you like.
```

??? question "What's a Virtual Environment"
??? question "What's a Virtual Environment?"

A virtual environment is a self-contained directory that contains a Python installation for a particular version
of Python, plus a number of additional packages. It allows you to work on a specific project without affecting
Expand All @@ -33,9 +43,23 @@ guide.
It's a good practice to create a new virtual environment for each project you work on. This way, you can install the
specific versions of the packages you need for that project without affecting other projects.
3. Activate the virtual environment
=== "Windows"
!!! warning "Windows Permissions"
The first time you run the command below, you will likely need to change your PowerShell execution policy
to allow running scripts. You can do this by running the following command in PowerShell:
```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```
You should only need to do this once. After that, you can activate the virtual environment as written above.
If you skip this, you will see an error message saying something like *`kelpTest\Scripts\activate.ps1 cannot
be loaded because running scripts is disabled on this system.`*
```powershell
.\my_env_name\Scripts\activate
```
Expand All @@ -62,9 +86,21 @@ Now that you have your virtual environment set up, you can install Kelp-O-Matic
`uv`.
1. Install Kelp-O-Matic using the following command:
```bash
uv pip install kelp-o-matic
```
=== "Windows"
If you have a NVIDIA GPU:
```powershell
uv pip install kelp-o-matic --index-url https://download.pytorch.org/whl/cu124
```
Otherwise:
```powershell
uv pip install kelp-o-matic
```
=== "MacOS/Linux"
```bash
uv pip install kelp-o-matic
```
!!! important
Expand Down
5 changes: 2 additions & 3 deletions docs/beginner_guide/terminal_crash_course.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Terminal Crash Course
# Crash Course on the Terminal

The terminal is a text-based interface to your computer. It allows you to run
commands to interact with your computer. The terminal is where you will run the
Expand All @@ -13,8 +13,7 @@ depending on your operating system, so choose the tab below based on which is re
On Windows, there are two default terminal options: Command Prompt and PowerShell.
You can use either of these to run the Kelp-O-Matic tool. We recommend using PowerShell.

To open PowerShell, search for "PowerShell" in the search bar and click on the
application that appears.
To open PowerShell, search for "PowerShell" in the search bar and click on "Windows PowerShell".

=== "MacOS/Linux"
On MacOS and Linux, the default terminal is called Terminal. To open Terminal, search for "Terminal" in the search bar
Expand Down
6 changes: 3 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ nav:
- Home: index.md
- Beginner Guide:
- beginner_guide/index.md
- Terminal Crash Course: beginner_guide/terminal_crash_course.md
- Installation and Virtual Environment Setup: beginner_guide/install_env_setup.md
- Running the Segmentation Tool: beginner_guide/execution.md
- Crash Course on the Terminal: beginner_guide/terminal_crash_course.md
- Environment Setup and Installation: beginner_guide/install_env_setup.md
- Processing Images: beginner_guide/execution.md
- Post-Processing: beginner_guide/post_processing.md
- Installation: installation.md
- Data Requirements: expectations.md
Expand Down

0 comments on commit 7c1a0dc

Please sign in to comment.