Skip to content

Instantly share code, notes, and snippets.

View irexyc's full-sized avatar
🎯
Focusing

Chen Xin irexyc

🎯
Focusing
View GitHub Profile
@cobryan05
cobryan05 / fixNvPe.py
Last active January 25, 2024 14:33
Python Script to disable ASLR and make nv fatbins read-only to reduce memory commit
# Simple script to disable ASLR and make .nv_fatb sections read-only
# Requires: pefile ( python -m pip install pefile )
# Usage: fixNvPe.py --input path/to/*.dll
import argparse
import pefile
import glob
import os
import shutil
@andrewjong
andrewjong / pytorch_image_folder_with_file_paths.py
Last active February 27, 2024 09:24
PyTorch Image File Paths With Dataset Dataloader
import torch
from torchvision import datasets
class ImageFolderWithPaths(datasets.ImageFolder):
"""Custom dataset that includes image file paths. Extends
torchvision.datasets.ImageFolder
"""
# override the __getitem__ method. this is the method that dataloader calls
def __getitem__(self, index):