F1 SMOKE ELIMINATION
[Baseline] F1 Smoke Elimination
Remove Smoke baseline notebook from F1 Car Challenge of Blitz 8
Getting Started Code for Smoke Elimination Challenge on AIcrowd¶
Author : Shubhamai¶
Download Necessary Packages 📚¶
In [ ]:
!pip install --upgrade aicrowd-cli
Download Data ⏬¶
The first step is to download out train test data. We will be training a model on the train data and make predictions on test data. We submit our predictions.
In [ ]:
API_KEY = "950c83e4a1e610b75911247d23ac5492"
!aicrowd login --api-key $API_KEY
In [ ]:
!aicrowd dataset download --challenge f1-smoke-elimination -j 3
Below, we create a new directory to put our downloaded data! 🏎
We unzip the ZIP files and move the CSVs.
In [ ]:
!rm -rf data
!mkdir data
!unzip train.zip -d data/train >/dev/null
!unzip val.zip -d data/val >/dev/null
!unzip test.zip -d data/test >/dev/null
!unzip sample_submission.zip -d data/sample_submission >/dev/null
Import packages¶
In [ ]:
import cv2
import matplotlib.pyplot as plt
import os
from PIL import Image
from glob import glob
import random
from tqdm.notebook import tqdm
In [ ]:
data_directiory = "data"
test_data_path = os.path.join(data_directiory, "test/smoke")
test_submission_path = "clear"
Visualize the data 👀¶
In [ ]:
img = plt.imread(test_data_path+"/0.jpg")
plt.imshow(img)
Out[ ]:
Making a Random Submission¶
In [ ]:
!rm -rf clear
!mkdir clear
In [ ]:
# Output Image Width & hight
image_width, image_height = 256, 256
# Getting though corrupted images folder
for img_name in tqdm(os.listdir(test_data_path)):
# Opening the smoke image
img = Image.open(os.path.join(test_data_path, f"{img_name}"))
# Saving the output image :)
img.save(os.path.join(test_submission_path, f"{img_name}"))
Save the prediction to zip¶
In [ ]:
!zip submission.zip -r clear/ > /dev/null
In [ ]:
sample_output_img = plt.imread(os.path.join(test_submission_path, f"0.jpg"))
plt.imshow(sample_output_img)
Out[ ]:
🚧 Note :¶
- Do take a look at the submission format.
- Follow all submission guidelines strictly to avoid inconvenience.
Making direct submission thought aicrowd-cli¶
In [ ]:
!aicrowd submission create -c f1-smoke-elimination -f submission.zip
Content
Comments
You must login before you can post a comment.