Fog prediction from images using deep learning
Project description
FogVision
FogVision is an open-source Python framework for classifying mountain trail camera imagery by fog presence. First, image embeddings are computed using a pretrained ResNet50 model, and then a classification head was trained on ~40k images from 30 sites (separate classification head for diurnal and nocturnal imagery).
Installation
The source code can be found on GitHub at: https://github.com/jnicolow/FogVision/
FogVision is installable at the Python Package Index (PyPI).
pip install fogvision
Classify function
When using FogVision, you can use the classify function in a .ipynb file (Jupyter Notebook) to classify your images.
from fogvision import fv
fv.classify(image_folder, plot_image=False, save_csv_to=None, sitename=None, crop_size=None, random_crop=False, threshold=0.5)
Only image_folder is needed to run the function properly.
- image_folder (str): The path to the folder that contains the images to be classified.
- plot_image (bool): Determines whether or not an image is plotted or not. Default set to false.
- save-csv-to (str): Allows for a path to save the .csv file to, instead of the images folder.
- sitename: Allows for manual setting of the site name.
- crop-size (int): The side length (in pixels) of the square crop that is fed into the model. It controls how big the tensor is. If nothing is passed, then it chooses the largest square that fits in the image, rounded down to a multiple of 32.
- random-crop (bool): If false, the center square is always taken. If true, then a randomly positioned square is taken. Default set to false.
- threshold (int): By default, the threshold is 0.5. This means that if the inference value for the image is >= 0.5, then fog_val will be 1, but if it's less than 0.5, then fog_val will be 0. This option changes the threshold of the fog_val.
CLI Tool
FogVision can also be used in the command line using fogvision. Since images cannot be plotted in a command line, the original plot_image parameter is not included and set to false by default.
fogvision image_folder
--save-csv-to
--sitename
--crop-size
--random-crop
--threshold
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fogvision-0.1.3.tar.gz.
File metadata
- Download URL: fogvision-0.1.3.tar.gz
- Upload date:
- Size: 62.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b768a11e394d7ba79f4fcaa4c5c6484b3f5e12f6c4ce5a19fe4c0cac2396527
|
|
| MD5 |
63c9ca24c105aa2f1c08536f4edf4f9b
|
|
| BLAKE2b-256 |
33611d8f963133b1129fa9f68e706e0d2448bac986faf7a65f9318d4aaa6d629
|
File details
Details for the file fogvision-0.1.3-py3-none-any.whl.
File metadata
- Download URL: fogvision-0.1.3-py3-none-any.whl
- Upload date:
- Size: 62.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43c0f08948367ad52318240b08395028932a3b70ed2046c0f4c8f342dd4c8f7f
|
|
| MD5 |
f2f75828548f04f15e67e814b4d16269
|
|
| BLAKE2b-256 |
01d81e939014d1b5ce2b8469d6f1beba10b9fdf17feb66e0402b206691b876f2
|