Skip to content

Instantly share code, notes, and snippets.

View Im-Himanshu's full-sized avatar
🏠
Working from home

Himanshu Goyal Im-Himanshu

🏠
Working from home
View GitHub Profile
@Im-Himanshu
Im-Himanshu / Pandas working example code snippets.py
Last active April 27, 2023 14:12
Pandas basics and useful
#Apply Lambda function to pandas
# if we require other column as a logic for the new column
df = df.assign(Product=lambda x: (x['Field_1'] * x['Field_2'] * x['Field_3']))
# if we need to modify all the element of selected entity based only on that entity
# this will in-place update all the element
df = df.apply(lambda x: np.square(x) if x.name in ['a', 'e', 'g'] else x, axis=1)
# compare from the previous element of the colums use shift
@Im-Himanshu
Im-Himanshu / Oracle_VM_setup.txt
Last active April 9, 2023 16:48
Oracle VM setup
Vbox setup:
1. using the 7.0 and the iso file in my software.
download oracleVM: https://download.virtualbox.org/virtualbox/7.0.4/VirtualBox-7.0.4-154605-Win.exe
download ubuntu image: https://ubuntu.com/download/desktop
vboxuser, changeme, foghorn9152
2. Adjust the screen resolution:
display>video Memory> 128MB
enable 3d acceleration
go to : https://github.com/settings/tokens
generate a new token with all the repo access.
my token :
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
use
@Im-Himanshu
Im-Himanshu / gist:31edb4e1ddef8501a33b6fa943fd40a9
Created December 7, 2022 11:19
Setup CUDA and CUDNN in windows
https://towardsdatascience.com/python-environment-setup-for-deep-learning-on-windows-10-c373786e36d1
this article has all the links in short :
step-1 Install driver
https://www.nvidia.com/en-us/geforce/geforce-experience/
step-2: Install CUDA toolkit
https://developer.nvidia.com/cuda-toolkit-archive
Note: download 11.x for tf2 and 10.x for tf1
@Im-Himanshu
Im-Himanshu / Python VENV setup in windows
Last active December 14, 2022 07:51
Python VENV setup in windows
Install python AMDx64 version of desired python release (3.6, 3.8 etc) we can keep multiple python version together
In the end of this installation select the option to update the python_path variable this will make the python availaible in cmd
```
which Python
./venv/Scripts/activate
deactivate
```
Create venv :
-p : give path to specifc version of python to be used by venv
@Im-Himanshu
Im-Himanshu / openvino_in_windows
Created March 28, 2022 02:50
Steps required to install openvino in windows
Internally setupvars.sh edit two environment variable to include all openvino directory :
PYTHONPATH
PATH
Now these variable could easily be setup by running "C:\Program Files (x86)\IntelSWTools\openvino_2021.2.185\bin\setupvars.bat" in the same terminal in which you will run python but this will be temporary i.e. will work only in the current windows
To avoid running setupvars.sh everytime, you can permanently edit edit the environment variable as follows :
Copy the openvino python directory
source: C:\Program Files (x86)\IntelSWTools\openvino_2021.2.185\python\python3.8\openvino
dest : C:\\Users\goyal\Anaconda3\envs\tf2-gpu\lib\site-packages
@Im-Himanshu
Im-Himanshu / what-does-a-cnn-see.ipynb
Last active October 26, 2021 04:24
What does a CNN see?.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Im-Himanshu
Im-Himanshu / augment_folder.py
Created September 27, 2021 06:36
this script augment all the folders with a random combination of operation defined below, the given set of operation is optimize to create good variety of images but tweak them as per your convince.
# do image augmenation on a folder
import json;
import os
import shutil
import cv2;
import numpy as np
import random
import imgaug as ia
import copy
@Im-Himanshu
Im-Himanshu / jupyter_hacks.md
Last active May 13, 2021 11:32
list of hacks to make life easier while working with jupyter notebook #jupyter #notebooks #IPython #notebook #hacks #cheat-sheet

run jupyter notebook without tunnelling

jupyter notebook --port 3100 --ip 0.0.0.0 --no-browser

now run on IP address of the server like 10.10.5.49:3100/

make a cell run the bash command

use %%bash as the first line of the cell, will make the cell terminal

%%bash 
import { Component, OnInit, AfterViewInit } from '@angular/core';
import { ViewChild } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit,AfterViewInit {
@ViewChild('videoElement') videoElement: any;