Skip to content

Instantly share code, notes, and snippets.

View hazxone's full-sized avatar

M Hazwan hazxone

  • Datafyt
  • Malaysia
View GitHub Profile
@myounus96
myounus96 / convert_voc_to_yolo.md
Last active February 3, 2022 22:27 — forked from vdalv/convert_voc_to_yolo.md
convert pascal voc dataset to yolo format

Convert PascalVOC Annotations to YOLO

This script reads PascalVOC xml files, and converts them to YOLO txt files.

Note: This script was written and tested on Ubuntu. YMMV on other OS's.

Disclaimer: This code is a modified version of Joseph Redmon's voc_label.py

Instructions:

  1. Place the convert_voc_to_yolo.py file into your data folder.
import numpy as np
import matplotlib.pyplot as plt
# find the a & b points
def get_bezier_coef(points):
# since the formulas work given that we have n+1 points
# then n must be this:
n = len(points) - 1
# build coefficents matrix
@sol0invictus
sol0invictus / DDPG-buffer.py
Created May 30, 2020 18:38
DDPG - Replay Buffer
class BasicBuffer:
def __init__(self, size, obs_dim, act_dim):
self.obs1_buf = np.zeros([size, obs_dim], dtype=np.float32)
self.obs2_buf = np.zeros([size, obs_dim], dtype=np.float32)
self.acts_buf = np.zeros([size, act_dim], dtype=np.float32)
self.rews_buf = np.zeros([size], dtype=np.float32)
self.done_buf = np.zeros([size], dtype=np.float32)
self.ptr, self.size, self.max_size = 0, 0, size
@jackbrookes
jackbrookes / CoroutineTest.cs
Last active January 22, 2023 10:55
Simple extended Unity3D Coroutine interface. Allows checking if coroutine has finished, and a method to end the Coroutine early.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// Used to test the ExtendedCoroutine interface.
public class CoroutineTest : MonoBehaviour
{
// Start is called before the first frame update
IEnumerator Start()
@matheustguimaraes
matheustguimaraes / install-cuda-cudnn.md
Last active March 20, 2023 05:08
Install CUDA 10.0 and cuDNN v7.4.2 on Ubuntu 16.04

Install CUDA 10.0 and cuDNN v7.4.2 on Ubuntu 16.04

Install the latest NVIDIA driver

Update package lists, download and install NVIDIA driver

sudo apt-get update
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt install nvidia-410
@DataGreed
DataGreed / UnityNavMeshCheck.cs
Last active August 21, 2023 17:59
Checks that NavMeshAgent reached destination or gave up trying
public bool ReachedDestinationOrGaveUp()
{
if (!_navMeshAgent.pathPending)
{
if (_navMeshAgent.remainingDistance <= _navMeshAgent.stoppingDistance)
{
if (!_navMeshAgent.hasPath || _navMeshAgent.velocity.sqrMagnitude == 0f)
{
return true;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class BezierCurveScript : MonoBehaviour {
public class BezierPath
{
public List<Vector3> pathPoints;
private int segments;
@wberdowski
wberdowski / Popcat no-click bot POC.js
Last active December 8, 2023 04:38 — forked from DaWe35/Popcat click bot.js
Ban-proof popcat bot
/*
1) Open https://popcat.click
2) Open console (F12 or CTRL+SHIFT+I)
3) Insert code & run
4) Monitor bot progress in the console
Note: popcat.click server registers only 800 pops every 30 seconds per IP address (that's why this bot is slow and runnig it in multiple tabs won't work).
If you'll send 800 or more clicks 10 times in a row, you'll get banned for 12 hours ("ban" cookie is set).
This bot addresses this issue and will NOT get you banned.
@krzys-h
krzys-h / SaveRenderTextureToFile.cs
Last active December 22, 2023 10:33
[Unity] Save RenderTexture to image file
using UnityEngine;
using UnityEditor;
public class SaveRenderTextureToFile {
[MenuItem("Assets/Save RenderTexture to file")]
public static void SaveRTToFile()
{
RenderTexture rt = Selection.activeObject as RenderTexture;
RenderTexture.active = rt;
@Invertex
Invertex / CustomHoldingInteraction.cs
Last active February 1, 2024 16:00
Unity New Input System custom Hold "Interaction" where the .performed callback is constantly triggered while input is held.
using UnityEngine;
using UnityEngine.InputSystem;
//!!>> This script should NOT be placed in an "Editor" folder. Ideally placed in a "Plugins" folder.
namespace Invertex.UnityInputExtensions.Interactions
{
//https://gist.github.com/Invertex
/// <summary>
/// Custom Hold interaction for New Input System.
/// With this, the .performed callback will be called everytime the Input System updates.