Views
No views yet
Block 1: Conv(3→60) → ReLU → Conv(60→120, s=2) → ReLU → MaxPool(2)
Block 2: Conv(120→80) → ReLU → Conv(80→120) → ReLU → MaxPool(2)
Block 3: Conv(120→80) → ReLU → Conv(80→10) → ReLU → MaxPool(2)
Head: Flatten → Linear(160 → 4)1import torch
2from huggingface_hub import hf_hub_download
3from torchvision import transforms
4from PIL import Image
5
6weights_path = hf_hub_download(
7 repo_id="ArtInSoul/furniture-classifier",
8 filename="furniture_classifier.pth"
9)
10
11from src.model import FurnitureClassifier
12model = FurnitureClassifier(num_classes=4)
13model.load_state_dict(torch.load(weights_path, map_location="cpu", weights_only=True))
14model.eval()
15
16CLASS_NAMES = ["bed", "chair", "sofa", "table"]
17transform = transforms.Compose([transforms.Resize((64, 64)), transforms.ToTensor()])
18
19image = Image.open("your_image.jpg").convert("RGB")
20with torch.inference_mode():
21 probs = torch.softmax(model(transform(image).unsqueeze(0)).squeeze(), dim=0)
22
23print({CLASS_NAMES[i]: f"{probs[i]:.2%}" for i in range(4)})| Parameter | Value |
|---|---|
| Dataset | filnow/furniture-synthetic-dataset-30k (24k train / 6k test) |
| Optimizer | Adam — lr 0.001, weight decay 1e-4 |
| Epochs | 10 |
| Batch size | 32 |
| Hardware | NVIDIA T4 GPU (Google Colab) |
| Epoch | Train Acc | Test Acc |
|---|---|---|
| 1 | 86.1% | 94.4% |
| 5 | 98.2% | 97.6% |
| 6 | 98.1% | 98.5% |
| 10 | 98.8% | 96.8% |