This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -i | |
# What does this Script do ? | |
# Keep your most frequent bashrc / zshrc configs here. Now when you | |
# login to a new machine, instead of all the copy past hazzle, just | |
# run these commands to sync your bashrc/zshrc config file from here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from transformers import ViTFeatureExtractor, ViTForImageClassification | |
import requests | |
from io import BytesIO | |
from PIL import Image | |
model_name_or_path = 'vit-base-avengers-v1' | |
feature_extractor = ViTFeatureExtractor.from_pretrained(model_name_or_path) | |
model = ViTForImageClassification.from_pretrained(model_name_or_path) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from transformers import ViTFeatureExtractor, ViTForImageClassification, Trainer, TrainingArguments | |
import torch | |
from datasets import load_dataset, load_metric | |
import numpy as np | |
DATASET_DIR = '/content/output' | |
dataset = load_dataset(name="avengers", path=DATASET_DIR, data_files={"train": "/content/output/train/**", "test": "/content/output/val/**"}) | |
labels = dataset['train'].features['label'].names |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This a header file that includes every standard library. | |
You can use it to save time. | |
NOTE: This header file may not be recognized by compilers | |
other than gcc. | |
*/ | |
#include <bits/stdc++.h> | |
#include<tuple> // support from c++11 only. use the option -std=c++11 for g++ if there is any problem | |
/* |