Loading

Generative Interior Design Challenge 2024

Generative Interior Design Submission using Colab

Generative Interior Design Submission notebook using Colab's Free version

saidinesh_pola

Make your first submission using the baseline starter kit from Aicrowd and explore your local evaluation results in colab.

Switch to GPU acceleration by changing the runtime type for faster inference times. πŸš€

Mount the gdrive

In [1]:
from google.colab import drive
drive.mount('/content/drive')
Mounted at /content/drive

Clone the gitlab Repo

Step 0 : Fork the baseline to make your own changes to it. Go to settings and make the repo private.

Step 1 : For first time setup, Setting up SSH to login to Gitlab.

  1. Run the next cell to check if you already have SSH keys in your drive, if yes, skip this step.
  2. Run ssh-keygen -t ecdsa -b 521
  3. Run cat ~./ssh/id_ecdsa.pub and copy the output
  4. Go to Gitlab SSH Keys and then paste the output inside the key and use whaever title you like.

Step 2: Clone your forked Repo & Add Models & Push Changes

  1. Run git clone git@gitlab.aicrowd.com:[Your Username]/<starter-kit>
  2. Put your model inside the models directioary and then run git-lfs track "*.bit"
  3. Run git add . then git commit -m " adding model"
  4. Run git push origin master

Step 3. Create Submission

  1. Go to the repo and then tags and then New Tag.
  2. In the tag name,you can use submission_v1, ( Everytime you make a new submission, just increase the no. like - submission_v2, submission_v3 )
  3. A new issue will be created with showing the process. Enjoy!

If you do not have SSH Keys, Check this Page

Add your SSH Keys to your GitLab account by following the instructions here

In [2]:
%%bash
SSH_PRIV_KEY=/content/drive/MyDrive/cdpc/id_ecdsa
SSH_PUB_KEY=/content/drive/MyDrive/cdpc/id_ecdsa.pub
if [ -f "$SSH_PRIV_KEY" ]; then
    echo "SSH Key found! βœ…\n"
    mkdir -p /root/.ssh
    cp /content/drive/MyDrive/id_ecdsa ~/.ssh/id_ecdsa
    cp /content/drive/MyDrive/id_ecdsa.pub ~/.ssh/id_ecdsa.pub
    echo "SSH key successfully copied to local!"
else
    echo "SSH Key does not exist."
    ssh-keygen -t ecdsa -b521 -f ~/.ssh/id_ecdsa
    cat ~/.ssh/id_ecdsa.pub
    echo "❗️Please open https://gitlab.aicrowd.com/profile/keys and copy-paste the above text in the **key** textbox."
    cp  ~/.ssh/id_ecdsa /content/drive/MyDrive/id_ecdsa
    cp  ~/.ssh/id_ecdsa.pub /content/drive/MyDrive/id_ecdsa.pub
    echo "SSH key successfully created and copied to drive!"
fi
SSH Key found! βœ…\n
SSH key successfully copied to local!
In [ ]:
import IPython

html = "<b>Copy paste below SSH key in your GitLab account here (one time):</b><br/>"
html += '<a href="https://gitlab.aicrowd.com/-/profile/keys" target="_blank">https://gitlab.aicrowd.com/-/profile/keys</a><br><br>'

public_key = open("/content/drive/MyDrive/id_ecdsa.pub").read()
html += '<br/><textarea>'+public_key+'</textarea><button onclick="navigator.clipboard.writeText(\''+public_key.strip()+'\');this.innerHTML=\'Copied βœ…\'">Click to copy</button>'
IPython.display.HTML(html)
Out[ ]:
Copy paste below SSH key in your GitLab account here (one time):
https://gitlab.aicrowd.com/-/profile/keys


Clone the gitlab starter repo and add submission files

In [3]:
# Set your AIcrowd username for action submission.
# This username will store repository and used for submitter's username, etc
username = "saidinesh_pola" #@param {type:"string"}
!echo -n {username} > author.txt
In [ ]:
%%bash

username=$(cat author.txt)
echo "Username $username"

git config --global user.name "$username"
git config --global user.email "$username@noreply.gitlab.aicrowd.com"

touch ${HOME}/.ssh/known_hosts
ssh-keyscan -H gitlab.aicrowd.com >> ${HOME}/.ssh/known_hosts 2> /dev/null


apt install -qq -y jq git-lfs &> /dev/null

git lfs install
cd /content/

echo "Checking if repository already exist, otherwise create one"

export SUBMISSION_REPO="git@gitlab.aicrowd.com:$username/generative-interior-design-challenge-2024-starter-kit.git"
echo "cloning the $SUBMISSION_REPO"
git clone --depth 1 $SUBMISSION_REPO aicrowd_repo --branch master
ALREADYEXIST=$?

if [ $ALREADYEXIST -ne 0 ]; then
  echo "Project didn't exist, forking from upstream"
  git clone --depth 1 https://gitlab.aicrowd.com/$username/generative-interior-design-challenge-2024-starter-kit.git  aicrowd_repo --branch master
fi

cd /content/aicrowd_repo
git remote remove origin
git remote add origin "$SUBMISSION_REPO"

Check the size and last commit of the repo

In [ ]:
!du -sh  /content/aicrowd_repo
%cd /content/aicrowd_repo
!git log

Local Evaluation

In [ ]:
#import os
#os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "max_split_size_mb:512"
#!pip install accelerate colorful einops bitsandbytes==0.42.0 peft==0.8.2  >> /dev/null
!pip install colorful diffusers xformers >> /dev/null

Try changing the controlnet Hyper paramaters and observe the generated images from outputs folder

In [ ]:
%%time

%cd /content/aicrowd_repo
!python local_evaluation.py

To make active submission:

  • Required Files are aicrowd.json, apt.txt, requirements.txt (already configured for mmdetection)

  • [IMP] Modify aicrowd.json for your GPU submission

Submission 🤩

In [ ]:
%%bash

## Set your unique tag for this submission (no spaces), example:
# export MSG="v1"
# export MSG="v2" ...
# or something more informative...
export MSG="sample_submission_1.2"

username=$(cat /content/author.txt)
echo "Username $username"


cd /content/aicrowd_repo
# Update this based on your model's checkpoint file extension
git lfs track "*.bin" "*.safetensors" ".ckpt"
git add .gitattributes
git add --all
git commit -m "$MSG" || true

find . -type f -size +5M -exec git lfs migrate import --include={} &> /dev/null \;

git tag -am "submission_$MSG" "submission_$MSG"
git config lfs.https://gitlab.aicrowd.com/$username/generative-interior-design-challenge-2024-starter-kit/info/lfs.locksverify false

git remote remove origin
git remote add origin git@gitlab.aicrowd.com:$username/generative-interior-design-challenge-2024-starter-kit.git

git lfs push origin best
git push origin best
git lfs push origin "submission_$MSG"
git push origin "submission_$MSG"

echo "Track your submission status here: https://gitlab.aicrowd.com/$username/generative-interior-design-challenge-2024-starter-kit/issues"

πŸ–ΌοΈ If you see this πŸ“Έ in the terminal, your submission has been created successfully! πŸŽ‰
Screenshot from 2024-03-19 09-04-04.png


Comments

You must login before you can post a comment.

Execute