Skip to content

Instantly share code, notes, and snippets.

View kobybibas's full-sized avatar

Koby Bibas kobybibas

  • Tel Aviv, Israel
View GitHub Profile
# Having a requirements.txt file has follows
torch==1.5.0
numpy==1.18.1
# Add channels. Last added is with the highest priorety
conda config --add channels pytorch
conda config --add channels conda-forge
conda config --add channels anaconda
# Install pip for fallback
@kobybibas
kobybibas / tensorboard_aws_port_fordwing.txt
Last active June 9, 2020 17:00
Connect to TensorBoard that is running on a remote server.
# In .ssh/config file:
Host aws
HostName **********.compute.amazonaws.com
User ubuntu
IdentityFile ******.pem
IdentitiesOnly yes
LocalForward 6006 0.0.0.0:600
# In aws server
tensorboard --logdir .
@kobybibas
kobybibas / delete_git_submodule.md
Created July 6, 2020 07:10 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@kobybibas
kobybibas / pytorch_acceleration.md
Last active October 5, 2020 08:00
Pytorch acceleration tips
@kobybibas
kobybibas / ffmpeg_center_crop_and_scale.sh
Last active March 14, 2021 12:48
Crop, scale and compress a video
# Crop such that the output is heightxheight. Then scale to 640:640. finally videeo compression ("28", higher is more compression)
ffmpeg -i intput -filter:v "crop=ih:ih,scale=640:-2" -crf 28 output.mp4
# Split a video to 280 sec segments
ffmpeg -i input.mp4 -acodec copy -f segment -segment_time 280 -vcodec copy -reset_timestamps 1 -map 0 output_%d.mp4
# Crop with side by side merge (https://stackoverflow.com/questions/35349935/ffmpeg-crop-with-side-by-side-merge)
ffmpeg -i in0.mp4 -i in1.mp4 -filter_complex "[0:v]crop=iw/2:ih:0:0[left]; [1:v]crop=iw/2:ih:ow:0[right]; [left][right]hstack" output.mp4
@kobybibas
kobybibas / install_blender_python_api.md
Last active August 17, 2023 01:05
Blender python api installation on macOS
# To see what volumes are avilable
lsblk
# c5
sudo mount /dev/nvme1n1 /data
# p2
sudo mount /dev/xvdf /data
@kobybibas
kobybibas / .vscode
Last active July 3, 2022 07:31
.vscode/launch.json so that the cwd will be the file folder
// launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",