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
https://github.com/tensorboy/pytorch_Realtime_Multi-Person_Pose_Estimation | |
https://github.com/tensorboy/3d-pose-baseline | |
http://www.tvmlang.org/2017/10/06/nnvm-compiler-announcement.html |
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 torch_trainer.trainer import Trainer | |
from torch_trainer.callbacks import rms_callback | |
from torch import nn | |
from torch.optim import Adam | |
import torch.nn.functional as F | |
import numpy as np | |
import pandas as pd | |
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 typing import get_type_hints | |
def cast(argname, value, hints): | |
""" Only cast arguments if type hints are available for them. | |
""" | |
if argname in hints: | |
expected_type = hints[argname] | |
if not issubclass(type(value), expected_type): | |
# Will throw type error if argument cannot be cast |
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
def check_line_by_line(fn_result, fn_truth): | |
logger.info(f"Checking line by line in {fn_result} and {fn_truth}") | |
with open(fn_result, 'r') as results: | |
res = results.readlines() | |
with open(fn_truth, 'r') as truth: | |
tru = truth.readlines() | |
for i, (line_t, line_r) in enumerate(zip(tru, res)): | |
features = line_t.split('\x01') |
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
def switch_modal_function(stub=None, use_modal=True, **kwargs): | |
def wrapper(inner_func): | |
if use_modal: | |
assert stub is not None, "If using modal, please provide `stub`." | |
return stub.function(**kwargs)(inner_func) | |
else: | |
return inner_func | |
return wrapper |
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
import os | |
import pickle | |
import time | |
import glob | |
import joblib | |
import inspect | |
from loguru import logger | |
def persist_to_file(): |
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
import multiprocessing | |
import queue | |
from loguru import logger | |
import pandas as pd | |
def chunks(df, chunk_size=1000): | |
for i in range(0, len(df), chunk_size): | |
yield df[i : i + chunk_size] |
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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: vespa | |
labels: | |
app: vespa | |
spec: | |
selector: | |
app: vespa | |
type: NodePort |
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
β Initialized. View app at https://modal.com/apps/ap-lHATR9JHJ7S5eGXYHigc75 | |
β Created objects. | |
βββ π¨ Created sample_fn. | |
βββ π¨ Mounted /Users/chris/code/search/gumbase/jobs/partition.py at /root | |
βββ π¨ Mounted /Users/chris/code/gumhouse/gumhouse at /root/gumhouse | |
βββ π¨ Created sample_job. | |
βββ π¨ Created fit_top_level_kmeans. | |
βββ π¨ Created scatter_by_centroids_single. | |
βββ π¨ Created scatter_by_centroids. | |
βββ π¨ Created gather_single. |
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
import os | |
import io | |
import json | |
import math | |
import time | |
import random | |
import numpy as np | |
import cachetools.func | |
import sqlite3 | |
from loguru import logger |