Skip to content

Instantly share code, notes, and snippets.

View pritul2's full-sized avatar
😉

Pritul Dave pritul2

😉
View GitHub Profile
architecture: YOLOv3
use_gpu: false
max_iters: 250000
log_smooth_window: 100
log_iter: 100
save_dir: output
snapshot_iter: 10000
metric: COCO
pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/ResNet50_vd_ssld_pretrained.tar
weights: output/ppyolo/model_final
## Import Statements ##
import pickle
## Storing the Data ##
file = open('examplePickle', 'ab')
pickle.dump(model, file)
file.close()
## Retriving the Data ##
file = open('examplePickle', 'rb')
## Creating the enviornment
conda create -n tensorflow1 python==3.6.9
#Check available environement on system
conda env list
#Activate environement
conda activate <name>
#Stable version of tensorflow 1
#Convert singular value of y to one hot encoding#
from tensorflow.keras.utils import to_categorical
y_train_encoded = to_categorical(y_train)
y_test_encoded = to_categorical(y_test)
#Visualize the keras model#
from tensorflow.keras.utils import plot_model
from IPython.display import Image
plot_model(model, to_file='model.png', show_shapes=True, show_layer_names=True,rankdir='LR',dpi=96)#change rankdir='TB' for horizontal plot
\d : [0-9] single \D : not of \d
\w : [0-9][a-z][A-Z] single \W : not of \w
\s : whitespace or tab \S : not of \s
Special Characters:
. —> any character (including spaces)
* —> 0 or more
+ —> 1 or more
x? —> x is character and which is optional
[ ] —> referring as set of characters appearing anyone from set
1. Installation
sudo apt-get install python3.x
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3.x get-pip.py
pip install --upgrade virtualenv
2. Creating the virtual environment
Go to pycharm add python interpreter in virtualenv envirnomnet
Obtain installed path of python [usually /usr/bin/python3.x]
# compare different numbers of features selected using anova f-test
from numpy import mean
from numpy import std
from pandas import read_csv
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import RepeatedStratifiedKFold
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import f_classif
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import Pipeline
Alt + Enter --> Error, Suggestions and fixes
ctr + D ---> Duplicate the line
ctr + shift + arrow --> Change poisition of the line
ctr + X [without selecting] --> Delete whole line
ctr + / --> Adding comments
alt + shift + ctr + j ---> Multiple cursors on same occurence
shift + F6 --> refactor or rename variable with all occurence
ctr + alt + v --> convert expression to variable
ctr + alt + m --> convert expression to function
ctr + alt + l --> reformat the code
HTML quottation --> same as medium quotation
HTML image map --> Create the clickable areas on the image
Add icon to webpage --> HTML favicon
p and div vs when to use span --> p when we want to occupy new line vs span dont start in new line and dont add extra space
class vs id --> class can be assigned to many elements but id wont
<details> --> To provide small information in the form of widget
<figcaption> --> To provide the caption to the figure
&nbsp --> To add extra space ; &lt (less than) ; &gt (greater than) ; &amp (ampersand)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 12 10:49:03 2022
@author: pritul
"""
import pandas as pd
import os