Skip to content

Instantly share code, notes, and snippets.

View giangnguyen2412's full-sized avatar
🎯
Focusing

Giang Nguyen giangnguyen2412

🎯
Focusing
View GitHub Profile
# Create definitions for CUB-200 (CUB200 category definition - CUB200 class definition)
# All .txt files can be found here: https://www.kaggle.com/datasets/veeralakrishna/200-bird-species-with-11788-images?resource=download&select=CUB_200_2011.tgz
import re
import numpy as np
import pickle
# Read the class ID for each image. We have 11788 images, each image has a class ID from 1->200
img2class_file = 'image_class_labels.txt'
input_f = open(img2class_file)
img2class_dict = {}
@akTwelve
akTwelve / COCO_Image_Viewer.ipynb
Last active November 23, 2023 21:01
COCO Image Viewer | immersivelimit.com/tutorials/create-coco-annotations-from-scratch
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Index: src/main/java/org/alicebot/ab/AIMLProcessor.java
===================================================================
--- src/main/java/org/alicebot/ab/AIMLProcessor.java (revision 100)
+++ src/main/java/org/alicebot/ab/AIMLProcessor.java (working copy)
@@ -18,6 +18,8 @@
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
+import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
@L0SG
L0SG / freeze_example.py
Last active October 12, 2023 05:02
PyTorch example: freezing a part of the net (including fine-tuning)
import torch
from torch import nn
from torch.autograd import Variable
import torch.nn.functional as F
import torch.optim as optim
# toy feed-forward net
class Net(nn.Module):
def __init__(self):
@CMCDragonkai
CMCDragonkai / Matplotlib Backends.md
Last active February 12, 2023 13:22
Matplotlib Backends #matplotlib #python

Matplotlib Backends

Matplotlib is a plotting library. It relies on some backend to actually render the plots. The default backend is the agg backend. This backend only renders PNGs. On Jupyter notebooks the matplotlib backends are special as they are rendered to the browser. Generally you will not need to explicitly set the backend on a Jupyter notebook. This does introduce a discrepancy between code that runs in Jupyter and code that runs as a script natively in the Python interpreter. So you need to understand that the 2 environments are not the same

@zhanwenchen
zhanwenchen / Install NVIDIA Driver and CUDA.md
Last active March 13, 2024 23:42 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA CUDA 9.0 on Ubuntu 16.04.4 LTS
@aaronpolhamus
aaronpolhamus / map_clsloc.txt
Created May 12, 2016 01:21
Image net classes + labels
n02119789 1 kit_fox
n02100735 2 English_setter
n02110185 3 Siberian_husky
n02096294 4 Australian_terrier
n02102040 5 English_springer
n02066245 6 grey_whale
n02509815 7 lesser_panda
n02124075 8 Egyptian_cat
n02417914 9 ibex
n02123394 10 Persian_cat
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 18, 2024 00:56
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 18, 2024 10:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname