Views
No views yet
car, truck1from rfdetr import RFDETRMedium
2from PIL import Image
3
4# Load the model
5model = RFDETRMedium(
6 pretrain_weights="hf://schelian-uta/rfdetr-vehcile-39/checkpoint_best_total.pth"
7)
8model.optimize_for_inference()
9
10# Run inference
11image = Image.open("your_image.jpg")
12detections = model.predict(image, threshold=0.5)
13
14print(f"Found {len(detections)} detections")1import torch
2from huggingface_hub import hf_hub_download
3
4# Download the model weights
5model_path = hf_hub_download(
6 repo_id="schelian-uta/rfdetr-vehcile-39",
7 filename="pytorch_model.bin"
8)
9
10# Load the state dict
11state_dict = torch.load(model_path, map_location='cpu')checkpoint_best_total.pth: Original RF-DETR checkpoint (best model)pytorch_model.bin: Standard PyTorch weights for compatibilityconfig.json: Model configurationclass_names.txt: List of detection classesresults.json: Training results and metricsmetrics_plot.png: Visualization of training metricslog.json: Full training log