Skip to content

Instantly share code, notes, and snippets.

Avatar

nbswords

View GitHub Profile
View generate_test.py
import os
image_files = []
os.chdir(os.path.join("data", "test"))
for filename in os.listdir(os.getcwd()):
if filename.endswith(".jpg"):
image_files.append("data/test/" + filename)
os.chdir("..")
with open("test.txt", "w") as outfile:
for image in image_files:
View generate_train.py
import os
image_files = []
os.chdir(os.path.join("data", "obj"))
for filename in os.listdir(os.getcwd()):
if filename.endswith(".jpg"):
image_files.append("data/obj/" + filename)
os.chdir("..")
with open("train.txt", "w") as outfile:
for image in image_files:
@nbswords
nbswords / WIDER_FACE_covert_to_yolo.py
Last active Jun 26, 2021
WIDER_FACE_covert_to_yolo.py
View WIDER_FACE_covert_to_yolo.py
import os
import shutil
import cv2
def convert(size, box):
dw = 1./size[0]
dh = 1./size[1]
x = (box[0] + box[1])/2.0
y = (box[2] + box[3])/2.0
w = box[1] - box[0]
@nbswords
nbswords / XGBoost vs LightGBM vs CatBoost.ipynb
Created Jan 21, 2021
XGBoost vs LightGBM vs CatBoost.ipynb
View XGBoost vs LightGBM vs CatBoost.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.