
Weather Identification
Weather identification refers to the process of recognizing and categorizing the current weather conditions based on various atmospheric parameters and observable phenomena. It involves analyzing weather patterns, atmospheric data, and visual cues to determine the prevailing weather conditions at a particular location and time.
Weather Identification
Summary
Introduction
Weather identification refers to the process of recognizing and categorizing the current weather conditions based on various atmospheric parameters and observable phenomena. It involves analyzing weather patterns, atmospheric data, and visual cues to determine the prevailing weather conditions at a particular location and time.
In this task, there are common labels such as Cloudy, Rain, Shine Or Partly Cloudy, Sunrise.
Parameters
Inputs
- input - (image -.png|.jpg|.jpeg): The input of the model is an image of weather that needs to be identified.
Output
- output - (text): Includes the model's predictions for each label, displayed as probabilities.
Examples
input | output |
---|---|
![]() | ![]() |
Usage for developers
Please find below the details to track the information and access the code for processing the model on our platform.
Requirements
torch
fastai
opencv-python
Code based on AIOZ structure
from fastai.vision.all import load_learner
import cv2, torch, os
...
def do_ai_task(
input: Union[str, Path],
model_storage_directory: Union[str, Path],
device: Literal["cpu", "cuda", "gpu"] = "cpu",
*args, **kwargs) -> Any:
"""Define AI task: load model, pre-process, post-process, etc ..."""
# Define AI task workflow. Below is an example
path_weight = os.path.join(model_storage_directory, "model.pkl")
learn = load_learner(path_weight)
if torch.cuda.is_available():
learn.model.cuda()
categories = ('Cloudy','Rain','Shine Or Partly Cloudy','Sunrise')
image = cv2.imread(input)
_, _,probs = learn.predict(image)
out = dict(zip(categories,map(float,probs)))
for category, prob in out.items():
out[category] = round(prob, 5)
return str(out)
Reference
This repository is based on and inspired by Muhammad Shoaib Shafique's work. We sincerely appreciate their generosity in sharing the code.
License
We respect and comply with the terms of the author's license cited in the Reference section.