This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
@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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#ifdef __APPLE__ | |
#include <OpenCL/opencl.h> | |
#else | |
#include <CL/cl.h> | |
#endif | |
int main() { |