Skip to content

Instantly share code, notes, and snippets.

import json
import wandb
import pandas as pd
from datetime import datetime, timezone
from collections import defaultdict
from typing import List, Dict, Tuple, Optional, Any
def query_wandb_runs(project_name, entity_name=None, start_date=None, end_date=None, filters=None):
"""
@dylanuys
dylanuys / query.py
Created August 11, 2025 16:12
query
#!/usr/bin/env python3
"""
Simple Model Performance Tester using ContentManager for media sampling
This version uses the ContentManager class to sample media files, similar to the GAS validator.
"""
import os
import sys
import json
import time
#!/usr/bin/env python3
"""Simplified local inference server for model testing."""
print("🚀 Starting simple inference server script...")
import os
import sys
import time
from pathlib import Path
from typing import Dict, Any
@dylanuys
dylanuys / run_onnx.py
Last active August 1, 2025 08:34
Run ONNX Models
#!/usr/bin/env python3
import argparse
import numpy as np
import onnxruntime as ort
from PIL import Image
import torch
import time
from pathlib import Path
import cv2
@dylanuys
dylanuys / download_mask_from_run.py
Created July 8, 2025 06:34
Download mask predictions
import wandb
import os
import numpy as np
def download_wandb_file(run, file_path, output_dir="downloaded_files"):
"""
Download a file from a W&B run using the file path.
Args:
import json
import wandb
import pandas as pd
from datetime import datetime, timezone
from collections import defaultdict
from typing import List, Dict, Tuple, Optional, Any
import json
import wandb
import pandas as pd
from datetime import datetime, timezone
from collections import defaultdict
from typing import List, Dict, Tuple, Optional, Any
def query_wandb_runs(project_name, entity_name=None, start_date=None, end_date=None, filters=None):
"""
import torch
class ModelWrapper(torch.nn.Module):
def __init__(self, model):
super(ModelWrapper, self).__init__()
self.model = model
def forward(self, x):
data_dict = {'image': x} # model expects data dict as input
output = self.model(data_dict, inference=True)
import requests
import os
from pathlib import Path
import logging
def send_video_to_validator(
video_path: str,
api_url: str,
auth_token: str,
timeout: int = 40
@dylanuys
dylanuys / miner.py
Created August 19, 2024 14:56
neurons/miner.py image and prediction logging with json file rotation
# The MIT License (MIT)
# Copyright © 2023 Yuma Rao
# developer: dubm
# Copyright © 2023 Bitmind
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the “Software”), to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so, subject to the following conditions: