NghiMe commited on
Commit
034ff7b
·
verified ·
1 Parent(s): cd51106

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
README.md CHANGED
@@ -1,3 +1,73 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ task_categories:
4
+ - object-detection
5
+ tags:
6
+ - traffic-signs
7
+ - vietnam
8
+ - yolo
9
+ - residential-zone
10
+ - R420
11
+ - R421
12
+ size_categories:
13
+ - n<1K
14
+ ---
15
+
16
+ # VietSpeedYOLO — Residential zone traffic signs (R420/R421)
17
+
18
+ YOLO-format object detection dataset for **Vietnam residential-zone traffic signs**: **R420** (Bắt đầu khu dân cư) and **R421** (Hết khu dân cư). Use for speed-zone detection, ADAS, or traffic sign recognition in Vietnam.
19
+
20
+ ## Classes
21
+
22
+ | ID | Class name | Sign | Description |
23
+ |----|----------------|------|--------------------------|
24
+ | 0 | khu_dan_cu | R420 | Start of residential area |
25
+ | 1 | ngoai_dan_cu | R421 | End of residential area |
26
+
27
+ ## Dataset structure
28
+
29
+ Standard YOLO layout:
30
+
31
+ - **images/train/** — training images
32
+ - **images/val/** — validation images
33
+ - **labels/train/** — one `.txt` per image: `class_id x_center y_center width height` (normalized 0–1)
34
+ - **labels/val/** — validation labels
35
+ - **data.yaml** — dataset config (paths + class names)
36
+
37
+ ## Usage
38
+
39
+ ### With Ultralytics YOLO
40
+
41
+ ```bash
42
+ # Clone or download this repo, then:
43
+ yolo detect train data=data.yaml model=yolov8n.pt epochs=80 batch=16 imgsz=640
44
+ ```
45
+
46
+ ### With Python
47
+
48
+ ```python
49
+ from ultralytics import YOLO
50
+ model = YOLO("yolov8n.pt")
51
+ model.train(data="data.yaml", epochs=80, batch=16, imgsz=640)
52
+ ```
53
+
54
+ ### Loading from Hugging Face
55
+
56
+ After cloning or downloading the dataset from the Hub, point your training script to the local `data.yaml`. Paths in `data.yaml` are relative to the dataset root (this repo).
57
+
58
+ ## Statistics (example)
59
+
60
+ - Train: 94 original images (+ optional augmentation for training)
61
+ - Val: 23 images
62
+ - Labels: one text file per image, YOLO format
63
+
64
+ ## License
65
+
66
+ MIT.
67
+
68
+ ## Citation
69
+
70
+ If you use this dataset, please cite:
71
+
72
+ - **Dataset:** [NghiMe/vietspeedyolo](https://huggingface.co/datasets/NghiMe/vietspeedyolo) on Hugging Face
73
+ - **Code:** [nghimestudio/vietspeedyolo](https://github.com/nghimestudio/vietspeedyolo) on GitHub
README_TRAIN.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Train model nhận diện box + phân loại khu dân cư / ngoài khu dân cư
2
+
3
+ ## Dataset
4
+ - **traffic_residence_2class/** đã có 2 class:
5
+ - **0: khu_dan_cu** (Bắt đầu khu dân cư - R420)
6
+ - **1: ngoai_dan_cu** (Hết khu dân cư - R421)
7
+ - Mỗi file label `.txt`: `class_id x_center y_center width height` (chuẩn hóa 0–1).
8
+ - Một model YOLO vừa **tìm tọa độ box** vừa **phân loại** 0 hay 1.
9
+
10
+ ## Train
11
+ Từ thư mục `archive/`:
12
+
13
+ ```bash
14
+ # Cách 1: script
15
+ python3 train_residence_2class.py
16
+
17
+ # Cách 2: lệnh yolo
18
+ yolo detect train data=traffic_residence_2class/data.yaml model=yolov8n.pt epochs=80 batch=16 imgsz=640
19
+ ```
20
+
21
+ Sau khi train xong, weights nằm ở: **runs/detect/residence_2class/weights/best.pt** (hoặc runs/detect/train/ nếu dùng lệnh yolo trực tiếp).
22
+
23
+ ## Dùng model (inference)
24
+ Ảnh mới → model trả về **tọa độ từng box** và **class (0 hoặc 1)**:
25
+
26
+ ```bash
27
+ yolo detect predict model=runs/detect/residence_2class/weights/best.pt source=path/to/anh.jpg save
28
+ ```
29
+
30
+ Hoặc Python:
31
+
32
+ ```python
33
+ from ultralytics import YOLO
34
+ model = YOLO("runs/detect/residence_2class/weights/best.pt")
35
+ results = model.predict("anh.jpg", conf=0.25)
36
+ for r in results:
37
+ boxes = r.boxes.xyxy.cpu().numpy() # [x1,y1,x2,y2] từng box
38
+ classes = r.boxes.cls.cpu().numpy() # 0 hoặc 1
39
+ for box, cls in zip(boxes, classes):
40
+ x1, y1, x2, y2 = box
41
+ label = "khu_dan_cu" if cls == 0 else "ngoai_dan_cu"
42
+ # dùng (x1,y1,x2,y2) và label
43
+ ```
44
+
45
+ Kết quả: mỗi detection có **vị trí box** (x1,y1,x2,y2) và **nhãn** 0 (khu dân cư) hay 1 (ngoài khu dân cư).
data.yaml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ path: /Users/thanhnguyen/Downloads/archive/traffic_residence_2class
2
+ train: images/train
3
+ val: images/val
4
+
5
+ names:
6
+ 0: khu_dan_cu
7
+ 1: ngoai_dan_cu
images/train/000001.jpg ADDED

Git LFS Details

  • SHA256: 8f352e2f2fb9695c234f45d1d5e073e1c5e5bb677724e89bfabb3b4dcb1f32f2
  • Pointer size: 131 Bytes
  • Size of remote file: 200 kB
images/train/000003.jpg ADDED

Git LFS Details

  • SHA256: 5ed6d525da3d9186ef248ca3d504d3811b83c11c7185cd7182b7c009800d3bea
  • Pointer size: 131 Bytes
  • Size of remote file: 141 kB
images/train/000004.jpg ADDED

Git LFS Details

  • SHA256: 14ca9d5b55c1afbcb6f9e54c5030cfaf1006d5b64a0576f21edbf8bfe9d1fd11
  • Pointer size: 131 Bytes
  • Size of remote file: 235 kB
images/train/000005.jpg ADDED

Git LFS Details

  • SHA256: db2c6d75a5541abe25934d2ca74064a79ae26d69a9bcafa9ee4f23379f8050c0
  • Pointer size: 131 Bytes
  • Size of remote file: 130 kB
images/train/000006.jpg ADDED

Git LFS Details

  • SHA256: e45477aa3c69234ba42b8eb4a859cb5ef7afaf534939394b0ef18a1a37cc24cc
  • Pointer size: 131 Bytes
  • Size of remote file: 144 kB
images/train/000007.jpg ADDED

Git LFS Details

  • SHA256: 0e418e256c8c08de74c2d665ffe938cae06a37814f512214c839163a998d4506
  • Pointer size: 130 Bytes
  • Size of remote file: 95.9 kB
images/train/000009.jpg ADDED

Git LFS Details

  • SHA256: ae8f0354f902cda4ab9687190700e8bb186624fd6a266fb41ea6c064bfb6d528
  • Pointer size: 130 Bytes
  • Size of remote file: 76.2 kB
images/train/000011.jpg ADDED

Git LFS Details

  • SHA256: 999294eccc4047d70130bd38cb764d19cad1e944509f1625a35f83a48c36a7bd
  • Pointer size: 130 Bytes
  • Size of remote file: 82.2 kB
images/train/000012.jpg ADDED

Git LFS Details

  • SHA256: f1eb604dfe4ac435684cc7b1f3eecd8ca80050645dd5a05c32ae77064bc430f3
  • Pointer size: 130 Bytes
  • Size of remote file: 37.4 kB
images/train/000013.jpg ADDED

Git LFS Details

  • SHA256: 6d271ab7282d2aa3587513bff2e888ffe472af7eb8beca96d9015e0d26932754
  • Pointer size: 130 Bytes
  • Size of remote file: 44.5 kB
images/train/000014.jpg ADDED

Git LFS Details

  • SHA256: e3396f9eebe98263652bc4dade5b611e4f9426597b2170d24918f7ceec44461c
  • Pointer size: 130 Bytes
  • Size of remote file: 37.8 kB
images/train/000015.jpg ADDED

Git LFS Details

  • SHA256: 721c67412e05d179e6461cbbae4de56d85b9db90541185857e9847a219ed8dad
  • Pointer size: 130 Bytes
  • Size of remote file: 53.2 kB
images/train/000016.jpg ADDED

Git LFS Details

  • SHA256: ec8f5c94588115e52588ba03833698b77983789d1bd1906ea098ad4bb3ee33e4
  • Pointer size: 130 Bytes
  • Size of remote file: 55.9 kB
images/train/000018.jpg ADDED

Git LFS Details

  • SHA256: afdee079abf07a8b1c2ecbc556b93cd760b056b8d9a8696d408abff901867e49
  • Pointer size: 129 Bytes
  • Size of remote file: 9.12 kB
images/train/000020.jpg ADDED

Git LFS Details

  • SHA256: 98ccfb153044f24c1e6daad3e283506eb4006ecec0f76be8ca376edda9312f26
  • Pointer size: 131 Bytes
  • Size of remote file: 225 kB
images/train/000021.jpg ADDED

Git LFS Details

  • SHA256: 186d59986e298a8023a8eed868126032dc7d8163646cd9f1ffb196389cc72acc
  • Pointer size: 131 Bytes
  • Size of remote file: 230 kB
images/train/000023.jpg ADDED

Git LFS Details

  • SHA256: 30d245edbd3ae0650d8962922d9a5f8627c8554954d58915f2b106f0d2841e91
  • Pointer size: 131 Bytes
  • Size of remote file: 104 kB
images/train/000025.jpg ADDED

Git LFS Details

  • SHA256: 8041eb27b6dd31ad62375a722469cc8bd45e6b34b49342687d2f80dad980a48e
  • Pointer size: 130 Bytes
  • Size of remote file: 39.3 kB
images/train/000026.jpg ADDED

Git LFS Details

  • SHA256: 63421991f78c1e1ad71ca94c90b046488c254853f225025afa750dc82e256c30
  • Pointer size: 131 Bytes
  • Size of remote file: 126 kB
images/train/000027.jpg ADDED

Git LFS Details

  • SHA256: f8940ba31f55e9d2680fdeb46fa5eb37934f0ec6aece47932c00a6c645ddf23c
  • Pointer size: 130 Bytes
  • Size of remote file: 59.5 kB
images/train/000028.jpg ADDED

Git LFS Details

  • SHA256: e43f90a909a5158661c7cc0311cb96e3a4b9dc31e4cee3939eda44b702257ef8
  • Pointer size: 131 Bytes
  • Size of remote file: 101 kB
images/train/000029.jpg ADDED

Git LFS Details

  • SHA256: 9481485abafafa60f7b4b13d856f46318cd03097a7e7fe1f4e760453912080b3
  • Pointer size: 130 Bytes
  • Size of remote file: 88.5 kB
images/train/000030.jpg ADDED

Git LFS Details

  • SHA256: e450e52afb4a326d82da339cfa886cc64efa5ab34852f0848e78c144f511047b
  • Pointer size: 131 Bytes
  • Size of remote file: 144 kB
images/train/000031.jpg ADDED

Git LFS Details

  • SHA256: 115085d57a479088a6094daa7da1a53a958e26dc882ed009cd81b7099cd14b7c
  • Pointer size: 130 Bytes
  • Size of remote file: 88.3 kB
images/train/000033.jpg ADDED

Git LFS Details

  • SHA256: 6246f32848c641d5b96e402973ebae222374ecdc4176d5ea20a9b5cb0e59e4c1
  • Pointer size: 130 Bytes
  • Size of remote file: 25.2 kB
images/train/000034.jpg ADDED

Git LFS Details

  • SHA256: 465765ae608ce4fab595a785169f59b1003367ba8a55aeb9f2846d620d26a222
  • Pointer size: 131 Bytes
  • Size of remote file: 520 kB
images/train/000035.jpg ADDED

Git LFS Details

  • SHA256: 0328562ab7e5a5369c2ba165cd0c3e9b7858678987fa27e4292b5569cc31015c
  • Pointer size: 130 Bytes
  • Size of remote file: 12.1 kB
images/train/000036.jpg ADDED

Git LFS Details

  • SHA256: 9a31a73117a2ca86417563565bcea9b42085f080168a734058e587c2f8d77cef
  • Pointer size: 131 Bytes
  • Size of remote file: 200 kB
images/train/000038.jpg ADDED

Git LFS Details

  • SHA256: 4dedad8fbe8fc1dce63e04ccb501f7da8a3686880fc81946efa510205a9990a5
  • Pointer size: 131 Bytes
  • Size of remote file: 194 kB
images/train/000039.jpg ADDED

Git LFS Details

  • SHA256: a0d32d5ac367d10db831c7fba9fe9f79370d51e449359077f210c72f03cc608d
  • Pointer size: 130 Bytes
  • Size of remote file: 12.3 kB
images/train/000041.jpg ADDED

Git LFS Details

  • SHA256: fe2fe71caccaf3c33059b93bed10a0ba49563b51c25fd68d1e728d8d6ba8a7d6
  • Pointer size: 130 Bytes
  • Size of remote file: 15.8 kB
images/train/000042.jpg ADDED

Git LFS Details

  • SHA256: fc4872d6ec0db694fd999bde7e7bb86697c59deb913e7f71292dd01418abd0ab
  • Pointer size: 130 Bytes
  • Size of remote file: 22.3 kB
images/train/000043.jpg ADDED

Git LFS Details

  • SHA256: 8bdbbbd8a56afc430a6d200efb295338e41b7d3bf52e8815546855428b43178c
  • Pointer size: 130 Bytes
  • Size of remote file: 12.1 kB
images/train/000044.jpg ADDED

Git LFS Details

  • SHA256: e46e4bf522b9ae40c7cc8e71f9f01b496c176be332f5cd69dbce1d21f5122d38
  • Pointer size: 130 Bytes
  • Size of remote file: 25 kB
images/train/000046.jpg ADDED

Git LFS Details

  • SHA256: c36b342b8d027d181c7f771228b692aea1cca6e1c82dd8b1e75b335e5404b7a7
  • Pointer size: 130 Bytes
  • Size of remote file: 27 kB
images/train/000047.jpg ADDED

Git LFS Details

  • SHA256: 1bae629a35e96ab3272ffc2a8d03161a2789d70fc43a111c76149437c534e484
  • Pointer size: 130 Bytes
  • Size of remote file: 16.3 kB
images/train/000048.jpg ADDED

Git LFS Details

  • SHA256: 548c0fd27f64d0333ba900ff00c7d79fc7367d2ce21bb1eedb9adf544de76e5d
  • Pointer size: 130 Bytes
  • Size of remote file: 14.8 kB
images/train/000049.jpg ADDED

Git LFS Details

  • SHA256: 7e8cc86b03568e16ac6c4612d73d87fde1b840848037e8dfb967c30f3ea13e5f
  • Pointer size: 129 Bytes
  • Size of remote file: 8.83 kB
images/train/000050.jpg ADDED

Git LFS Details

  • SHA256: b6ec44570f1a81b4a29ee675162c027383d8f054de4009a01e578bf2e700da7b
  • Pointer size: 130 Bytes
  • Size of remote file: 22.8 kB
images/train/000051.jpg ADDED

Git LFS Details

  • SHA256: 6c04705c29f1ddc31de0906699830d2b4a8a1f6422b7ce091bb5080c8ef9afec
  • Pointer size: 130 Bytes
  • Size of remote file: 31.3 kB
images/train/000055.jpg ADDED

Git LFS Details

  • SHA256: b676a094cb03545fb9e332308790d102b8bbe3a54deaffef27cce052af7aaa68
  • Pointer size: 130 Bytes
  • Size of remote file: 18.7 kB
images/train/000056.jpg ADDED

Git LFS Details

  • SHA256: 0ad57824937b070e235ce8bad4c81c500f42b0842b6502fa79a19503005d0be8
  • Pointer size: 129 Bytes
  • Size of remote file: 3.03 kB
images/train/000058.jpg ADDED

Git LFS Details

  • SHA256: 800a7d3743048e1aff3d7d39decd37948c45be6aa17bd6cab6e192b573552e0e
  • Pointer size: 129 Bytes
  • Size of remote file: 2.37 kB
images/train/000059.jpg ADDED

Git LFS Details

  • SHA256: 1351a639ed02b020dc2092c3a109e03896f5a0d46b6a1a40204703f1b75f8ed2
  • Pointer size: 129 Bytes
  • Size of remote file: 2.37 kB
images/train/000060.jpg ADDED

Git LFS Details

  • SHA256: bce7b3d6627a1aa0ed25b7bf473ee4da9b4554a5327c2e130d73591135ab7090
  • Pointer size: 129 Bytes
  • Size of remote file: 2.17 kB
images/train/000061.jpg ADDED

Git LFS Details

  • SHA256: cd87e1b50fba1949b76ea23fa7de64ae65241d0bc7435f9099e3fe501df167a4
  • Pointer size: 130 Bytes
  • Size of remote file: 25.2 kB
images/train/000062.jpg ADDED

Git LFS Details

  • SHA256: 5fc810e9869715215f3f031c5ffe6c9f5940be302a968192b2e2eadcea5c3482
  • Pointer size: 130 Bytes
  • Size of remote file: 26.1 kB