This file contains hidden or 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
{ | |
"name": "<your-project>", | |
"build": { | |
"dockerfile": "../Dockerfile", | |
"args":{ | |
"GCLOUD_ACCESS_TOKEN": "$(gcloud auth print-access-token)" | |
} | |
}, | |
"mounts": [ | |
"source=${localEnv:HOME}/.config/gcloud,target=/root/.config/gcloud,type=bind" |
This file contains hidden or 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 tensorrt as trt | |
import pycuda.autoinit | |
import pycuda.driver as cuda | |
from typing import List | |
import numpy as np | |
import cv2 | |
import numpy as np |
This file contains hidden or 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 -m torch.distributed.launch --nproc_per_node=2 main_dino.py --arch resnet34 --optimizer sgd --lr 0.03 --weight_decay 1e-4 --weight_decay_end 1e-4 --global_crops_scale 0.14 1 --local_crops_scale 0.05 0.14 --data_path /opt/datasets/imagenet/ILSVRC/Data/CLS-LOC/train --output_dir /opt/datasets/dino/ |
This file contains hidden or 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
class Scopes: | |
Training = "train" | |
Validation = "val" | |
Test = "test" | |
# support multiple experiment types and structures with ease | |
class Metrics: | |
Loss = "loss" | |
class ObjectDetection: |
This file contains hidden or 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 Optional, List | |
from dataclasses import dataclass | |
@dataclass | |
class MetricsInstagram: | |
train_loss: Optional[float] = None | |
val_loss: Optional[float] = None | |
val_accuracy: Optional[float] = None |
This file contains hidden or 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
class ApiRoot: | |
Base = "/api" | |
Frontend = "/ui" | |
class Users: | |
inner_base = ApiRoot.Base + "/users" | |
Register = inner_base + "/register" | |
ByName = lambda name: ApiRoot.Users.inner_base + f"/{name}" |
This file contains hidden or 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
class ApiRoot: | |
Base = "/api" | |
Frontend = "/ui" | |
class Users: | |
inner_base = "/users" | |
Register = inner_base + "/register" | |
ByName = lambda name: ApiRoot.Users.inner_base + f"/{name}" |
This file contains hidden or 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
@0xeaa9e4314af47a92; | |
struct BoundingBox { | |
x @0: UInt16; | |
y @1: UInt16; | |
w @2: UInt16; | |
h @3: UInt16; | |
cls @4: Text; |
This file contains hidden or 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
match db.retrieve(&id) { | |
Ok(c) => match c { | |
Some(d) => { | |
/* map DataResource -> EventEntity */ | |
let ret = match d.value { | |
DataResourcePayload::String(x) => EventEntity{ id: d.id, value: EventValue::String(x)}, | |
DataResourcePayload::Float(x) => EventEntity{ id: d.id, value: EventValue::Float(x)}, | |
DataResourcePayload::Int(x) => EventEntity{ id: d.id, value: EventValue::Int(x)}, | |
DataResourcePayload::Bool(x) => EventEntity{ id: d.id, value: EventValue::Bool(x)}, | |
DataResourcePayload::CaptionedImage(x) => { |
This file contains hidden or 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
// alternatively, return a mutable DataResource | |
// and map the id and other metadata afterwards | |
let resource = match event.value { | |
// simple | |
EventValue::String(x) => DataResource{ id: event.id, value: DataResourcePayload::String(x)}, | |
EventValue::Float(x) => DataResource{ id: event.id, value: DataResourcePayload::Float(x)}, | |
EventValue::Int(x) => DataResource{ id: event.id, value: DataResourcePayload::Int(x)}, | |
EventValue::Bool(x) => DataResource{ id: event.id, value: DataResourcePayload::Bool(x)}, |
NewerOlder