Skip to content

Instantly share code, notes, and snippets.

View geminixiang's full-sized avatar
🦜

Ying Xiang geminixiang

🦜
  • GliaCloud
  • Taipei
View GitHub Profile
@rochacbruno
rochacbruno / validate_dataclass.py
Created September 30, 2021 11:13
Validate Dataclass Python
from typing import Union, List
from dataclasses import dataclass
class Validations:
def __post_init__(self):
"""Run validation methods if declared.
The validation method can be a simple check
that raises ValueError or a transformation to
@laygond
laygond / mrcnn_continous_run.sh
Last active April 24, 2023 13:29
Allows matterport's MRCNN to run in sections so that every few epochs it re-executes # and, therefore, resets the memory solving provisionally the memory leak issue.
# -----------------------------
# USAGE
# -----------------------------
# chmod +x mrcnn_continous_run.sh
# source mrcnn_continous_run.sh
#
# DESCRIPTION:
# Allows matterport's MRCNN to run in sections so that every few epochs it re-executes
# and, therefore, resets the memory solving provisionally the memory leak issue.
#
@re4388
re4388 / model.py
Last active January 6, 2021 03:08
maskrcnn_compatible_tf_2.1
"""
Mask R-CNN
The main Mask R-CNN model implemenetation.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
"""
# change related API to make this file run mark rcnn demo competible
@Eotones
Eotones / README.md
Last active March 14, 2024 08:30
speechSynthesis強制使用Chrome中的Google小姐中文語音

speechSynthesis強制使用Chrome中的Google小姐中文語音

網路上的window.speechSynthesis教學主要都只有說切換指定語言

像是這樣就能切換成中文語音:

const synth = window.speechSynthesis;

const speak = (msg) => {
@hjbotha
hjbotha / free_ports.sh
Last active July 10, 2024 17:33
Free ports 80 and 443 on Synology NAS
#! /bin/bash
# NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION
# Developed for DSM 6 - 7.0.1. Not tested on other versions.
# Steps to install
# Save this script in one of your shares
# Edit it according to your requirements
# Backup /usr/syno/share/nginx/ as follows:
# # cd /usr/syno/share/
# # tar cvf ~/nginx.tar nginx
@AruniRC
AruniRC / ms_coco_classnames.txt
Created March 5, 2018 20:37
Class Names of MS-COCO classes in order of Detectron dict
{0: u'__background__',
1: u'person',
2: u'bicycle',
3: u'car',
4: u'motorcycle',
5: u'airplane',
6: u'bus',
7: u'train',
8: u'truck',
9: u'boat',
@ptxmotc
ptxmotc / 公車API資料使用注意事項.md
Created January 4, 2018 09:07
公車API資料使用注意事項.md

市區公車及公路客運API動靜態資料

  1. 動態資料傳遞延遲

公路客運六都市區公車動態資料延遲時間(來源端—PTX平台):

動態資料延遲時間
公總 即時推播,約2~3秒
台北市 約10秒
@sam0737
sam0737 / clock.html
Last active April 25, 2024 12:24
OBS Studio: A HTML page for showing current date and time in the video
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>A simple clock</title>
</head>
<body translate="no" >
@yunjey
yunjey / download_flickr_image.py
Last active December 26, 2023 15:22
downloading images from flickr using python-flickr
# First, you should install flickrapi
# pip install flickrapi
import flickrapi
import urllib
from PIL import Image
# Flickr api access key
flickr=flickrapi.FlickrAPI('c6a2c45591d4973ff525042472446ca2', '202ffe6f387ce29b', cache=True)
// Find a "pivot" element in the array to compare all other
// elements against and then shift elements before or after
// pivot depending on their values
function QuickSort(arr, left = 0, right = arr.length - 1) {
let len = arr.length,
index
if(len > 1) {
index = partition(arr, left, right)