Skip to content

Instantly share code, notes, and snippets.

View Lmy0217's full-sized avatar
🎯
Anti-996

Mingyuan Luo Lmy0217

🎯
Anti-996
View GitHub Profile
@Lmy0217
Lmy0217 / start.sh
Created September 1, 2017 02:53
Install environmental scripts such as CUDA+cuDNN+Torch on Google GPU VMs
#!/bin/bash
echo "Checking for CUDA and installing."
# Check for CUDA and try to install.
if ! dpkg-query -W cuda; then
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_8.0.61-1_amd64.deb
dpkg -i ./cuda-repo-ubuntu1404_8.0.61-1_amd64.deb
apt-get update
apt-get install cuda -y
apt-get install linux-headers-$(uname -r) -y
fi
@Lmy0217
Lmy0217 / bwlabel.cpp
Last active June 7, 2022 07:24
Implementation Of The Concatenation Domain Mark Function Bwlabel (Matlab) In C++. Input: binary (binary image array), row (image high), col (image width). Output: bwlabel (an array of the connected domain, and a serial number for each connected domain in the image. In particular, bwlabel[0] stores the serial number of the maximum connected area).
#include<vector>
#include<string>
#include<stdio.h>
using namespace std;
typedef struct Run {
int row;
int startCol;
int endCol;
int flag;