Skip to content

Instantly share code, notes, and snippets.

View chiehpower's full-sized avatar
🎯
Focusing on work

CHIEH chiehpower

🎯
Focusing on work
View GitHub Profile
@chiehpower
chiehpower / test_detect.py
Last active May 18, 2020 01:31
For detectron2 issue
import numpy as np
import cv2
import os
import sys
import requests
import torch
import detectron2
#from detectron2.utils.visualizer import Visualizer
from detectron2.data.catalog import MetadataCatalog, DatasetCatalog
>>>> ZSH
ZSH_THEME="bunnyruni"
plugins=(git zsh-wakatime)
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.0/lib64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/chieh/Downloads/TensorRT7_cuda100/lib
export CUDA_HOME=/usr/local/cuda-10.0
export CUDA_INSTALL_DIR=/usr/local/cuda-10.0
#export CUDNN_INSTALL_DIR=/home/chieh/Downloads/cuda_102_cudnn76
@chiehpower
chiehpower / Give the file name and location and return the whole path
Last active August 6, 2020 07:17
Give the file name and location and return the whole path
File = 'file_name.txt'
Location = '/home/chieh/(Path)'
File_path = os.path.join(os.path.abspath(Location), File)
assert os.path.isfile(File_path), "Cannot find the file_name.txt file."
with open(File_path, 'r') as f:
data = f.read().splitlines()
@chiehpower
chiehpower / Powerful tool list
Last active October 30, 2020 08:43
Powerful tool list
Powerful tools:
- Typora : https://typora.io/
- Marp : https://marp.app/
- Slides : https://slides.com/
- Whimsical : https://whimsical.com/
- Flameshot : https://flameshot.js.org/#/
For Data Visualization:
- StreamLit : https://www.streamlit.io/
@chiehpower
chiehpower / vs code extensions
Last active April 29, 2022 00:49
VS Code Extension
Extension List:
- Better Comments : https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments
- Atom One Dark Theme : https://marketplace.visualstudio.com/items?itemName=akamud.vscode-theme-onedark
- Power Mode : https://marketplace.visualstudio.com/items?itemName=hoovercj.vscode-power-mode
- Python : https://marketplace.visualstudio.com/items?itemName=ms-python.python
- Material Icon Theme : https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme
- TODO Highlight : https://marketplace.visualstudio.com/items?itemName=wayou.vscode-todo-highlight
- Markdown All in One : https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
- Remote - Containers : https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers
import sys
import xlwt
book = xlwt.Workbook(encoding="utf-8")
sheet1 = book.add_sheet("Sheet1")
def main(orig_args, data):
filename = "speed_time.xls"
output(filename, data)
import os
def batch_rename(path):
count = 0
total = len(os.listdir(path))
for fname in os.listdir(path):
time = total - len(str(count))
Extension = fname.split('.')[-1]
new_fname = str(0*(time)) + str(count) + '.' + Extension
file name : .flake8
```
[flake8]
max-line-length = 100
```
file name : .editorconfig
```
@chiehpower
chiehpower / Dockerfile ENV
Last active November 15, 2021 07:01
The question is "When we use the ENV instruction in the dockerfile, can we can keep it in the environment after the container is built?"
FROM nvcr.io/nvidia/tensorrt:20.03-py3
ENV TEST_PAR=TEST_dockerfile_env
@chiehpower
chiehpower / setup_zsh_script.sh
Last active July 29, 2022 06:48
Set up ZSH and packages
#!/bin/bash
apt-get update && apt-get install -y zsh autojump fonts-powerline
sudo chsh -s /bin/zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true
## Resolved: Could not resolve host: github.com
git config --global --unset http.proxy
git config --global --unset https.proxy