Skip to content

Instantly share code, notes, and snippets.

Avatar
🚧
WIP

Bayu Aldi Yansyah pyk

🚧
WIP
View GitHub Profile
@pyk
pyk / EDVR_test_video_without_gt.py
Created Sep 13, 2020
Apply pre-trained EDVR model without the ground truth
View EDVR_test_video_without_gt.py
class VideoTestDatasetWithoutGT(data.Dataset):
"""Video test dataset.
More generally, it supports testing dataset with following structures:
dataroot
├── subfolder1
├── frame000
├── frame001
├── ...
├── subfolder1
├── frame000
@pyk
pyk / Windows 10 Fix docker-credential-desktop not installed or not available in PATH.md
Created Apr 24, 2020
Windows 10 Fix docker-credential-desktop not installed or not available in PATH
View Windows 10 Fix docker-credential-desktop not installed or not available in PATH.md

When try to run AWS Lambda locally on windows:

sam local invoke

I got the following error:

Invoking app.lambda_handler (python3.8)
View Set-Window.ps1
Function Set-Window {
<#
.SYNOPSIS
Retrieve/Set the window size and coordinates of a process window.
.DESCRIPTION
Retrieve/Set the size (height,width) and coordinates (x,y)
of a process window.
.PARAMETER ProcessName
@pyk
pyk / python-on-windows-10.md
Last active Jan 30, 2020
Setup Python development in Windows 10
View python-on-windows-10.md

Python Setup

Download and install Python 3.8.

Open the folder using VSCode.

Open the VSCode terminal using CTRL + J.

Then create new virtualenv using the following command:

View vscode-settings.json
{
"editor.fontSize": 14,
"workbench.colorTheme": "Visual Studio Light",
"workbench.colorCustomizations": {
"[DuoTone Dark Sea]": {
"sideBar.background": "#1D262F",
"sideBar.foreground": "#bec9d3",
"sideBar.dropBackground": "#bec9d3",
"sideBarTitle.foreground": "#444c55",
"sideBarSectionHeader.background": "#1D262F",
View dataset.csv
total_miles total_paid
390.0 36.66
403.0 37.05
396.5 34.71
383.5 32.5
321.1 32.63
391.3 34.45
386.1 36.79
371.8 37.44
404.3 38.09
View requirements.txt
Click==7.0
Flask==1.0.2
gunicorn==19.9.0
itsdangerous==1.1.0
Jinja2==2.10
MarkupSafe==1.1.0
Werkzeug==0.14.1
View app.py
from flask import Flask
import config
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@pyk
pyk / config.py
Last active Feb 18, 2019
config.py
View config.py
from os import environ as env
import multiprocessing
PORT = int(env.get("PORT", 8080))
DEBUG_MODE = int(env.get("DEBUG_MODE", 1))
# Gunicorn config
bind = ":" + str(PORT)
workers = multiprocessing.cpu_count() * 2 + 1
threads = 2 * multiprocessing.cpu_count()
View convert_dataset_to_raw_text.py
import json
output = open("kumparan-news-dataset-19062018-16112018.txt", "w")
for line in open("typo-detector-dataset.json"):
data = json.loads(line)
output.write(data["title"].strip() + "\n")
if "content" in data:
output.write(data["content"].strip() + "\n")
You can’t perform that action at this time.