Skip to content

Instantly share code, notes, and snippets.

View dyd1234's full-sized avatar
🎯
Focusing

dyd1234

🎯
Focusing
View GitHub Profile
@nanguoyu
nanguoyu / fast_torchvision_dataloader.py
Last active July 18, 2024 12:16
Fast image dataloader for Pytorch models
"""
@File : fast_torchvision_dataloader.py
@Author: Dong Wang
@Date : 2024/06/25
@Description : a fast image dataloader for Pytorch models. It tries to use FFCV to speed up your dataloader for vision tasks.
You need first install FFCV in your Python ENV and run prepare_ffcv_dataset.py to prepare datasets in FFCV.
"""
import os
from torch.utils.data import DataLoader
@nanguoyu
nanguoyu / OpenCV_GPU.sh
Last active March 4, 2021 23:51
Install OpenCV with GPU support
sudo apt-get install qt5-default
sudo apt-get install opencl-headers
sudo pip install pylint
# Install minimal prerequisites (Ubuntu 18.04 as reference)
sudo apt update && sudo apt install -y cmake g++ wget unzip
# Download and unpack sources
wget -O opencv.zip https://github.com/opencv/opencv/archive/master.zip
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/master.zip
unzip opencv.zip
unzip opencv_contrib.zip
@courtneyfaulkner
courtneyfaulkner / devices.c
Created December 11, 2013 22:20
List OpenCL platforms and devices
#include <stdio.h>
#include <stdlib.h>
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
#endif
int main() {