Skip to main content

Fog prediction from images using deep learning

Project description

FogVision

Last Commit GitHub issues License: MIT GitHub commit activity

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).

FogVision can be installed either at the Python Package Index (PyPI) or through the command line. It can then be utilized, either with Jupyter Notebook or from the command-line to perform inferences on images.

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 folder path which 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 path/to/images

--save-csv-to (str)
--sitename
--crop-size (int)
--random-crop (bool)
--threshold (int)

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

fogvision-0.1.2.tar.gz (62.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fogvision-0.1.2-py3-none-any.whl (62.2 MB view details)

Uploaded Python 3

File details

Details for the file fogvision-0.1.2.tar.gz.

File metadata

  • Download URL: fogvision-0.1.2.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

Hashes for fogvision-0.1.2.tar.gz
Algorithm Hash digest
SHA256 21600734da46a46905ac85653df9f7003bdf0bc98439f0c3ba69c2ad5fbbe2b2
MD5 e66ee76e47b36a07451e1556d64c1157
BLAKE2b-256 e5085efe9a8ab79537b3f546b237c187b648f5e1f41a6c1acade3fc5dd30c562

See more details on using hashes here.

File details

Details for the file fogvision-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: fogvision-0.1.2-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

Hashes for fogvision-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1977a0a1a901c793871b9c77b74acf981c9988ba9fc45cf8886577dfe15647fb
MD5 95911adc02953b3636a5697633d631a3
BLAKE2b-256 ffd2ffa32cc56d85e9676a4562a3e622415e6de8043eabb15b0fe36ecb3987dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page