This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM --platform=linux/amd64 python:3.10-alpine as build | |
COPY ./ /src | |
WORKDIR /src | |
RUN \ | |
apk update && \ | |
apk add py3-pandas && \ | |
apk add --no-cache postgresql-libs && \ | |
apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Web3 = require('web3'); | |
const web3 = new Web3(new Web3.providers.HttpProvider('<Node API endpoint>')); | |
const balanceOfABI = [ | |
{ | |
"constant": true, | |
"inputs": [ | |
{ | |
"name": "_owner", | |
"type": "address" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nonMaxSuppression: function(scores, boxes) { | |
const self = this | |
let zipped = [] | |
for (let i = 0; i < scores.length; i++) { | |
zipped.push([ | |
scores[i], [boxes[4*i], boxes[4*i + 1], boxes[4*i + 2], boxes[4*i + 3]], i | |
]) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
computeBoundingBoxes: function(features) { | |
return tf.tidy(function() { | |
const confidenceThreshold = tf.scalar(0.5) | |
const num_classes = cocoClasses.length | |
const num_anchors = YOLO_ANCHORS.length | |
const anchors = tf.tensor2d(YOLO_ANCHORS) | |
const anchors_tensor = tf.reshape(anchors, [1, 1, num_anchors, 2]) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
toTensor: function(canvas) { | |
return tf.tidy(() => { | |
// Convert the ImageData to Tensor | |
const image = tf.fromPixels(canvas) | |
// The input shape of YOLO is 416x416x3, we need to crop the image | |
const size = this.size.width | |
const beginX = image.shape[1] / 2 - size / 2 | |
const beginY = image.shape[0] / 2 - size / 2 | |
const cropped = image.slice([beginY, beginX, 0], [size, size, 3]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tensorflowjs_converter --input_format keras yolov2-tiny.h5 web_model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python yad2k.py yolov2-tiny.cfg yolov2-tiny.weights model_data/yolov2-tiny.h5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://pjreddie.com/media/files/yolov2-tiny.weights > yolov2-tiny.weights | |
curl https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolov2-tiny.cfg > yolov2-tiny.cfg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PieProgressView: UIView { | |
public var progress:Float { | |
get { | |
return _progress | |
} | |
set { | |
_progress = newValue | |
self.updatePath() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require("http"); | |
var urlParser = require('url'); | |
var names = ["Jim Chang", "Max Liu", "Sara Ku", "Sophie", "Justin", "Brendon", "Jeniffer", "Cherry", "Alice", "John", "Bill", "James", "Steven", "Steve Chen", "Bill Gates", "Steve Jobs", "Mark"] | |
var currencies = ["HKD", "USD", "TWD", "PHP", "MYR", "RMB", "YEN"]; | |
var notes = ["Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it.", | |
"Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma - which is living with the results of other people's thinking. Don't let the noise of others' opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition.", | |
"Innovation distinguishes between a leader and a follower.", |
NewerOlder