This file contains 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
pred_final = np.round(0.3*pred_1 + 0.6*pred_2 + 0.1*pred_3) | |
# evalution | |
accuracy = round(accuracy_score(y_test, pred_final) * 100, 3) | |
auc = round(roc_auc_score(y_test, pred_final), 3) | |
print(f" Accuracy: {accuracy}%") | |
print(f" AUC score: {auc}") |
This file contains 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
# Utility | |
import pandas as pd | |
import numpy as np | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import roc_auc_score,accuracy_score | |
from sklearn.preprocessing import StandardScaler | |
# machine learning | |
from sklearn.ensemble import RandomForestClassifier | |
from sklearn.linear_model import LogisticRegression, SGDClassifier |
This file contains 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 tqdm.notebook import tqdm | |
colors = ["Blue","Green","Yellow","White","Gray","Black"] | |
for x in tqdm(colors): | |
sleep(1) | |
print(x) |
This file contains 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 tqdm.notebook import trange | |
for i in trange(10, desc='Traning Model on 10 Epochs'): | |
sleep(0.01) | |
for x in trange(10000, desc=f'Epoch {i}'): | |
sleep(0.001) |
This file contains 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
HF_TOKEN = os.getenv("HF_TOKEN") | |
hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "savtadepth-flags") | |
iface = gr.Interface( | |
gen, | |
gr.inputs.Image(shape=(640, 480), type="numpy"), | |
"image", | |
title=title, | |
description=description, | |
article=article, |
This file contains 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
git add . | |
git commit -m "first commit to HF Spaces" | |
git push gradio master:main -f |
This file contains 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
-f https://download.pytorch.org/whl/cpu/torch_stable.html | |
dvc==2.9.5 | |
fastai==2.5.3 | |
torch==1.10.2+cpu | |
gradio==2.8.1 |
This file contains 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
--- | |
title: Monocular Depth Estimation | |
emoji: 🛋 | |
colorFrom: gray | |
colorTo: yellow | |
sdk: gradio | |
app_file: app/app_savta.py | |
pinned: false | |
license: mit | |
--- |
This file contains 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
git remote add gradio https://huggingface.co/spaces/kingabzpro/savtadepth |
This file contains 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
import os | |
PROD_MODEL_PATH = "src/models" | |
TRAIN_PATH = "src/data/processed/train/bathroom" | |
TEST_PATH = "src/data/processed/test/bathroom" | |
if os.path.isdir(".dvc"): | |
print("Running DVC") | |
os.system("dvc config cache.type copy") | |
os.system("dvc config core.no_scm true") |
NewerOlder