ORIENT Rubiks Cube
Getting Started Notebook for Orient Rubik's Cube
A getting started notebook with random submission for the challenge.
Getting Started Notebook for Orient Rubik's Cube Challenge¶
This notebook creates a random prediction for the test data and takes you through the workflow of how to download data and submit directly via the notebook.
Note: Create a copy of the notebook and use the copy for submission. Go to File > Save a Copy in Drive to create a new copy
In [ ]:
!pip install aicrowd-cli
%load_ext aicrowd.magic
Login to AIcrowd ㊗¶
In [ ]:
%aicrowd login
Download Dataset and Unzip¶
We will create a folder name data
and download and unzip the files there.
In [ ]:
# Downloading the Dataset
!rm -rf data
!mkdir data
%aicrowd ds dl -c orient-rubiks-cube -o data
In [ ]:
!unzip data/train_images -d data/train_images > /dev/null
!unzip data/test_images -d data/test_images > /dev/null
Generating Random Submission ⚙️¶
Making a submission with random predictions. We will randomly select a number from 0
to 360
for each image in test set.
In [ ]:
# Imporitng libraries
import pandas as pd
import os
import random
random.seed(42)
In [ ]:
# Making a list containing all unique classes in the training set
testing_img_ids = [f"00{i}.jpg" if len(str(i)) <= 4 else f"0{i}.jpg" for i in range(5000, 10001)]
# Creating a list containing random classes of size equal of no. of samples in test data
random_test_predictions = [random.randint(0, 360) for i in range(len(testing_img_ids))]
In [ ]:
# Converting the list to dataframe
predictions_df = pd.DataFrame({"filename" : testing_img_ids, "xRot": random_test_predictions})
predictions_df
Out[ ]:
In [ ]:
# Saving the dataframe to csv
predictions_df.to_csv("submission.csv", index=False)
Submitting the predictions to AIcrowd¶
In [ ]:
# Submitting the Predictions
!aicrowd submission create -c orient-rubiks-cube -f submission.csv
In [ ]:
Content
Comments
You must login before you can post a comment.