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.0.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.0-py3-none-any.whl (62.2 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fogvision-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 d88bcf824a15bc49c3c3ee1cfe81df5b46ece6a781c0dad848b080998d406677
MD5 a4a931d2178aa0aeeae23917af8963e1
BLAKE2b-256 db629a8288ed705e7c9c6841026a3ee5ef8a654e999d1fcd5df5e9c033b31285

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fogvision-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46c240199878c817205596f09cd23cef2771d131f8b3f0cd195e0d169c034152
MD5 ee61847df70ee9c29168c9db6691e994
BLAKE2b-256 8f90f44135806c61dafd13714679775eec0d61d78c6a8cb49667e737f2362bcd

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