https://github.com/precision-sustainable-ag/SemiF-Preprocessing/tree/feature/reimplementation
NCSU Unity ID and password
Duo 2-Factor Authentication Enabled
Access to SUNNY
An internet connection
Cisco Secure Global Connect (NCSU’s VPN Client)
make sure that PowerShell is installed
PowerShell is automatically installed on Windows 10 and higher - it’s also available on MacOS and Linux
If you don’t have Windows PowerShell, install it using winget
in Command Prompt
winget install Microsoft.PowerShell
https://www.ionos.com/digitalguide/server/configuration/powershell-ssh/
Open Windows PowerShell
To enable SSH capabilities you will need administrator privileges. To run PowerShell as an administrator run the command Start-Process powershell -Verb RunAs
in PowerShell
In the window that opens run Start-Service sshd
If an error occurs saying that the service does not exist run the command Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Then run Start-Service sshd
We recommend running Set-Service -Name sshd -StartupType 'Automatic'
to automatically start SSHD to make sure it stays enabled in the future
Finally, run the following command to verify that the SSHD setup process automatically configured the firewall rule:
if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue | Select-Object Name, Enabled)) { Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it..." New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 } else { Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists." } |
You can now use ssh
to setup remote connection to SUNNY in PowerShell
Install Visual Studio Code https://code.visualstudio.com/
Install Remote-SSH Extension https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh
Open Cisco Secure Global Connect on your computer
Type vpn.ncsu.edu
into the blank field
Click Connect
Login to the VPN using your NCSU credentials
login: <unityID>
password: <password>
second password: <method of 2-Factor Authentication>
The default method is push
and leaving the field blank or typing push
will prompt the Duo Mobile App to send a request
If you type sms
, you will receive a code via text that is valid for 10 minutes
If type code
, the Duo Mobile App will generate a code that is valid for 30 seconds and can be seen by selecting the three vertical dots
in the app
For both sms
and code
once you receive the code, submit the login information again, but this time use the SMS code or Duo Code as the Second Password
In PowerShell run winget install X410
https://x410.dev/cookbook/built-in-ssh-x11-forwarding-in-powershell-or-windows-command-prompt/
run X410 by running the command x410.exe
Now run $env:DISPLAY="127.0.0.1:0.0"
Run echo $env:DISPLAY
you should see 127.0.0.1:0.0
You may also choose to make DISPLAY
a permanent environment variable in your windows machine. To do so, run the command setx DISPLAY "127.0.0.1:0.0"
After running setx
you will need to close and reopen PowerShell
Open PowerShell, Visual Studio Code, Sublime or other ssh-capable code editor
In PowerShell run the command ssh -Y <unityID>@SUNNY.ece.ncsu.edu
where <unityID>
is your NCSU Unity ID
Enter your password and hit Enter
(Note: the characters you type will not show up in the console)
You can end your remote session without disconnecting from the VPN by typing exit
and hitting Enter
You can end your remote session without disconnecting from the VPN by typing exit
and hitting Enter
Check that you have access to all of the storage lockers by running the following commands
ls /mnt/research-projects/s/screberg/longterm_images
ls /mnt/research-projects/s/screberg/longterm_images2
ls /mnt/research-projects/s/screberg/GROW_DATA
ls /mnt/research-projects/r/raatwell/longterm_images3
If you do not have access to one or more of the lockers, contact mkutugata@ncsu.edu
miniconda
on SUNNYDownload miniconda
by running wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
Install miniconda
using the command bash ~/Miniconda3-latest-Linux-x86_64.sh
Press Enter
to review Anaconda’s Terms of Service (TOS).
Then press and hold Enter
to scroll (this will take a little while as the TOS is long)
Once you see Please answer 'yes' or 'no':'
Enter yes
to agree to the TOS.
Hit Enter
to confirm the installation location to your home SUNNY folder
Type yes
to set up conda
to automatically initialize whenever you open a new shell
Run the command source ~/.bashrc
to refresh your terminal and apply the new settings
Test your installation by running conda list
. If conda
has been installed correctly, a list of installed packages appears.
All information that follows assumes that you are actively logged into SUNNY remotely using |
In your remote SUNNY session, run the command git clone https://github.com/precision-sustainable-ag/SemiF-Preprocessing.git
to clone the SemiF-Preprocessing repository to your SUNNY account
To check if the repository was cloned, you can run the command ls
to list everything in your current directory
Use the command cd SemiF-Preprocessing
to change directories
conda
environment in SUNNYRun the command conda env create -f ./environment.yaml
Then run the command conda activate semif_prep
Install PiDNG
by running pip install git+https://github.com/schoolpost/PiDNG.git
Manually install RawTherapee CLI
by running the command scripts/validate_rawtherapee.sh
.
The conda
environment you are in is shown in parentheses before your user <unityID>@sunny:
For example, if the base
environment is active it will appear as such: (base) <unityID>@sunny:
If the semif_prep
environment is active it will appear as (semif_prep) <unityID>@sunny:
To change your active environment run the command conda activate <EnvironmentName>
To update your environment after making changes to the environment.yaml
file, run:
conda env update --file environment.yaml
In your SUNNY session, change directories to SemiF-Preprocessing using the command cd SemiF-Preprocessing
Make sure that semif_prep
is the active conda
environment by running conda activate semif_prep
Edit conf/config.yaml
by running nano conf/config.yaml
batch_id
: batch you want to preprocess
tasks/copy_from_lockers
: copy raw files from LTS to ./data/<lts_location>/semifield-upload/<batch_id>
(comment out if already downloaded)
tasks/raw2jpg
: convert local raw files to jpegs stored in LTS: <lts_location>/semifield-developed-images/<batch_id>
tasks/raw2png
and tasks/png2jpg
can be left commented out unless you need to run these separately
raw2png/remove_raws
: delete local raw files when each file is converted to pngs
raw2jpg/remove_pngs
: delete local png files when each png is converted to jpeg
When you have finished editing, hit Ctrl
and X
at the same time
Type Y
to save the newly edited file
Hit Enter
to save the newly edited file as config.yaml
Run the command python main.py
to execute the main.py
python script in the SemiF-Preprocessing
directory
. ├── conf │ ├── ccm # config files to define color correction matrix (ccm) │ ├── config.yaml │ ├── hydra │ └── paths ├── data │ └── semifield-utils │ └── image_development │ ├── color_matrix # ccm files saved as numpy arrays │ └── dev_profiles # rawtherapee pp3 profile ├── main.py # main entry point for omegaconf ├── scripts │ └── validate_rawtherapee.sh # script to validate rawtherapee installation └── src ├── archive # archived code for future reference ├── raw2jpg.py # convert downloaded raw image to jpeg (raw2png + png2jpg processing) ├── png2jpg.py # convert png files to jpeg ├── raw2png.py # convert raw images to png └── utils ├── copy_from_lockers.py # copy raw files from NFS to local storage ├── calculate_ccm.py # utils to calculate and save ccm based on yaml config ├── debayer.py # demosaic image to manually record colorchecker values ├── preprocess.py # collection static methods for image preprocessing └── utils.py # common util functions |
to end your ssh
session type exit
Mobaxterm is a forwarding program - we dont need this for the svcam (we might need this TBD)
maybe get mobaxterm to view and validate images
try and run batch NC_2025-02-21
Need documentation on running the pipeline
be careful as lts is a shared long term storage, do not delete anything
access to SUNNY
miniconda installed https://www.anaconda.com/docs/getting-started/miniconda/install#macos-linux-installation
access to NFS locksers (longterm_images2, longterm_images, GROW_DATA)
cloning the repo