zaandahl / mewc

MEWC: Mega Efficient Wildlife Classifier
26 stars 2 forks source link

Example of data to supply in params.env when using Windows #3

Closed SimonKravis closed 5 months ago

SimonKravis commented 8 months ago

What data needs to appear in the params.env file specified in the Powershell examples? Is it simply the text below?

MODEL=EN-V2S CLW=512 LUF=360 SHAPES=300,300,300 BATCH_SIZES=128,128,128

SimonKravis commented 8 months ago

What should be in the files class_list.yaml and my_classifier_model.h5?

C:\mewc\ps\mewc_run_service.ps1 -i C:\example -p C:\mewc\model\params.env -c C:\mewc\yaml\class_list.yaml -m C:\mewc\model\my_classifier_model.h5 -g 0

zaandahl commented 8 months ago

The data that you supply to the params.env environment file is dependent on which tool you are running. Each of the GitHub pages has a table with the possible environmental variables and their default values.

The env variables you are asking about deal with EfficientNet classification and the code and documentation can be found at https://github.com/zaandahl/mewc-train and https://github.com/zaandahl/mewc-predict.

The initial pipeline for training would consist of taking your training images through the following steps:

mews-detect -> mewc-snip -> separate snips into labeled classes for training -> mewc-train

After this you can perform inference on new images using mewc-predict. This step will use a trained h5 model and class_list.yaml file that are produced by mew-train from the previous training step.

mews-detect -> mewc-snip -> mewc-predict

The names for these files are arbitrary and are determined by the arguments you pass to the PowerShell scripts.

Please let me know if this explanation helps.

Best, Zach

SimonKravis commented 8 months ago

Dear Zach

Thank you for your prompt and helpful reply. When I try to run mewc_detect get the output below and no process appears to be executing. Powershell needs to have Set-Execution-Policy Bypass executed in order to run an unsigned script. Docker Desktop also needs to be running. The target folder "C:\Users\simon\OneDrive\Pictures\Camera Trap\Fox Crow Training" contains a number of training jpg images and other files. The params.env file is as below.

Any advice you can give would be most welcome.

Regards

Simon Kravis

PS C:\Users\simon\OneDrive\Documents\mewc> C:\Users\simon\OneDrive\Documents\mewc\mewc_run_detect.ps1 -i "C:\Users\simon\OneDrive\Pictures\Camera Trap\Fox Crow Training" -p C:\users\simon\OneDrive\Documents\mewc\params.env -g 0

Using default tag: latest

latest: Pulling from zaandahl/mewc-detect

Digest: sha256:0b7d71b87f9a14d0b5ebce4e281f2f36e5d72c33977560dbfbb4d4812133b35b

Status: Image is up to date for zaandahl/mewc-detect:latest

docker.io/zaandahl/mewc-detect:latest

What's Next?

View a summary of image vulnerabilities and recommendations → docker scout quickview zaandahl/mewc-detect

PS C:\Users\simon\OneDrive\Documents\mewc>

Params.env content

MODEL=EN-V2S

CLW=512

LUF=360

SHAPES=300,300,300

BATCH_SIZES=128,128,128

From: Zach Aandahl @.> Sent: Monday, 22 January 2024 9:42 PM To: zaandahl/mewc @.> Cc: SimonKravis @.>; Author @.> Subject: Re: [zaandahl/mewc] Example of data to supply in params.env when using Windows (Issue #3)

The data that you supply to the params.env environment file is dependent on which tool you are running. Each of the GitHub pages has a table with the possible environmental variables and their default values.

The env variables you are asking about deal with EfficientNet classification and the code and documentation can be found at https://github.com/zaandahl/mewc-train and https://github.com/zaandahl/mewc-predict.

The initial pipeline for training would consist of taking your training images through the following steps:

mews-detect -> mewc-snip -> separate snips into labeled classes for training -> mewc-train

After this you can perform inference on new images using mewc-predict. This step will use a trained h5 model and class_list.yaml file that are produced by mew-train from the previous training step.

mews-detect -> mewc-snip -> mewc-predict

The names for these files are arbitrary and are determined by the arguments you pass to the PowerShell scripts.

Please let me know if this explanation helps.

Best, Zach

— Reply to this email directly, view it on GitHub https://github.com/zaandahl/mewc/issues/3#issuecomment-1903710836 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCCY6FLXUNAJ6P4NHSC2LDYPY65ZAVCNFSM6AAAAABCEUW6CGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBTG4YTAOBTGY . You are receiving this because you authored the thread. https://github.com/notifications/beacon/ACCCY6AMLYTTYKIXY2NNC6TYPY65ZA5CNFSM6AAAAABCEUW6CGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTRPBJHI.gif Message ID: @. @.> >

zaandahl commented 8 months ago

Hi Simon,

You can try starting the Docker container directly without the PowerShell script to see if it runs correctly. This will rule out if there are problems with the script or if the container is having trouble processing your images. Make sure your images are not nested in Fox Crow Training as the MegaDetector container only reads one level deep I think.

docker run --env CUDA_VISIBLE_DEVICES=0 --gpus all --volume "C:\Users\simon\OneDrive\Pictures\Camera Trap\Fox Crow Training":/images --env-file "C:\users\simon\OneDrive\Documents\mewc\params.env" zaandahl/mewc-detect

Please let me know if this works and if it doesn't let me know what the output is. Also make sure that you are running Windows 11 or a current version of Windows 10, you have current Nvidia drivers installed on your machine and the Docker Desktop is the latest version.

Best, Zach