File size: 1,805 Bytes
e804818
4fa703b
e804818
4fa703b
 
 
 
 
 
 
 
 
cb1faac
 
e804818
 
daa2a35
e804818
 
 
 
 
 
 
 
 
daa2a35
e804818
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
langauge: en
license: mit
tags:
  - image-classification
  - PyTorch
  - VehiclesClassification
  - image preprocessing
  - Xception
inference: true
datasets:
  - AIOmarRehan/Vehicles
spaces:
  - AIOmarRehan/CV_Model_Comparison_in_PyTorch
---

## Models Included

This repository provides three different trained PyTorch models for vehicle image classification:

| File Name                                 | Type                  | Description                                                                                                            |
| ----------------------------------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `best_model_finetuned_full.pt`            | PyTorch `.pt`         | Xception model with **two-phase transfer learning**, fine-tuned on the full dataset. Best generalization and accuracy. |
| `cnn_model_statedict_20260226_034332.pth` | PyTorch `.pth`        | **Custom CNN** trained from scratch. Baseline performance, high variance on unseen data.                               |
| `model.safetensors`                       | PyTorch `safetensors` | Lightweight **unified CNN model**, faster loading and inference, safe for sharing and reproducible deployment.         |

### How to Load

**PyTorch `.pt` or `.pth`:**

```python
import torch

# Load full model
model = torch.load("best_model_finetuned_full.pt")
model.eval()

# Or load CNN state dict
cnn_model = CustomCNN(num_classes=7)
cnn_model.load_state_dict(torch.load("cnn_model_statedict_20260226_034332.pth"))
cnn_model.eval()
```

**Safetensors:**

```python
from safetensors.torch import load_file

state_dict = load_file("model.safetensors")
model.load_state_dict(state_dict)
model.eval()
```