Skip to content

Instantly share code, notes, and snippets.

View fengyuentau's full-sized avatar
💥
Rock it!

Yuantao Feng fengyuentau

💥
Rock it!
  • Shenzhen, Guangdong, China
  • 17:47 (UTC +08:00)
View GitHub Profile
@zihaomu
zihaomu / OpenCV_with_TimVX.md
Last active July 24, 2022 15:50
Compile OpenCV with TimVX

Compiling OpenCV with TIM-VX backend

OpenCV with TIM-VX is developped to run deep learning models on NPUs (on Khadas VIM3 etc.) using OpenCV with TIM-VX integrated. Code is under review at opencv/opencv#21036. Inference performance on the NPU on Khadas VIM3 can be found in OpenCV Zoo: https://github.com/opencv/opencv_zoo#models--benchmark-results.

We provide two ways compiling OpenCV with TIM-VX backend:

  • (Recommanded) Compile OpenCV together with TIM-VX.
  • Compile OpenCV with TIM-VX library installed previously.

Requirements

@WesleyCh3n
WesleyCh3n / opencv_to_tflite.cpp
Last active August 25, 2023 15:53
Tensorflow Lite using cv::Mat as input (MobileNetV2)- C++ & Python
/* tflite model:
* - input shape: (224,224,3)
* - output shape: (128)
* In C++, cv::Mat should be flatten as input. If input has 3 channel,
* then it should be RGBRGBRGB... */
#include <iostream>
#include <iomanip>
#include "tensorflow/lite/interpreter.h"
@scottyhq
scottyhq / merge-conflict-rebase.md
Created August 10, 2020 18:25
GitHub PR Merge Conflict Resolution with Rebase

How to rebase a pull request to fix merge conflicts

It's quite common to open up a pull request on GitHub and be confronted with the message This branch has conflicts that must be resolved. This situation arises when you create a feature branch on an older commit from the master branch. Maybe you forgot to run git pull master before git checkout -b geocoding_vignette or maybe a collaborator changed some of the same files on GitHub while you've been working on new things. There are many ways to fix this. One is using the Web Editor build into GitHub and fixing conflicts by hand. This works great if there are not too many conflicts.

Another technique is to rebase your pull request onto the master branch (Move your additional commits on top of the most recent master commit). This is conceptually clean, but sometimes confusing in practice to do cleanly. This example walks through the process where you want to do a rebase, and resolve conflicts by overwriting whatever is on the master branch with change

@a-maumau
a-maumau / nvme_mount.md
Last active February 10, 2024 10:23
how to mount m.2 ssd/hdd
@yxlao
yxlao / tf_conv_gradients.py
Last active April 27, 2022 09:27
TensorFlow Convolution Gradients
"""
Demostrating how to compute the gradients for convolution with:
tf.nn.conv2d
tf.nn.conv2d_backprop_input
tf.nn.conv2d_backprop_filter
tf.nn.conv2d_transpose
This is the scripts for this answer: https://stackoverflow.com/a/44350789/1255535
"""
@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@DirtyF
DirtyF / README.md
Last active April 11, 2021 17:24
Setup Jekyll on macOS with brew and rbenv - See https://jekyllrb.com/docs/installation/macos/

First, make sure you have command line tools installed:

xcode-select --install

Then open Terminal.app and type:

curl https://gist.githubusercontent.com/DirtyF/5d2bde5c682101b7b5d90708ad333bf3/raw/fbc736fa1b50bd637929a315e6803df306c8bc8e/setup-rbenv.sh | bash
@evanwill
evanwill / gitBash_windows.md
Last active May 13, 2024 04:59
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@Integralist
Integralist / GitHub curl.sh
Last active September 7, 2023 03:53 — forked from madrobby/gist:9476733
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"