Generative Interior Design Challenge 2024
Generative Interior Design Submission using Colab
Generative Interior Design Submission notebook using Colab's Free version
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¶
from google.colab import drive
drive.mount('/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.
- Run the next cell to check if you already have SSH keys in your drive, if yes, skip this step.
- Run
ssh-keygen -t ecdsa -b 521
- Run
cat ~./ssh/id_ecdsa.pub
and copy the output - 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
- Run
git clone git@gitlab.aicrowd.com:[Your Username]/<starter-kit>
- Put your model inside the models directioary and then run
git-lfs track "*.bit"
- Run
git add .
thengit commit -m " adding model"
- Run
git push origin master
Step 3. Create Submission
- Go to the repo and then tags and then New Tag.
- In the tag name,you can use
submission_v1
, ( Everytime you make a new submission, just increase the no. like -submission_v2
,submission_v3
) - 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
%%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
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)
Clone the gitlab starter repo and add submission files
# 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
%%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
!du -sh /content/aicrowd_repo
%cd /content/aicrowd_repo
!git log
Local Evaluation¶
#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
%%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 🤩¶
%%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! π
Content
Comments
You must login before you can post a comment.