-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpath.txt
More file actions
66 lines (44 loc) · 2.27 KB
/
Copy pathpath.txt
File metadata and controls
66 lines (44 loc) · 2.27 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
CMD:
cd C:\tf
.venv\Scripts\activate
set PYTHONPATH=C:\tf\models;C:\tf\models\research;C:\tf\models\research\slim
cd models\research\object_detection
python Object_detection_image.py
Training (im Ordner object_detection):
Bilder nicht größer als 200KB mit höchstens 720 x 1280 --> 20% in \object_detection\images\test, 80% in \object_detection\images\train
(resizer.py Script zum Bilder verkleinern)
python xml_to_csv.py
(erstellt train_labels.csv- und test_labels.csv-Datei mit allen Daten aus den .xml-Datein der train- und test-Bilder)
generate_tfrecord.py im Texteditor öffnen und lable map ab Zeile 31 ersetzen
python generate_tfrecord.py --csv_input=images\train_labels.csv --image_dir=images\train --output_path=train.record
python generate_tfrecord.py --csv_input=images\test_labels.csv --image_dir=images\test --output_path=test.record
(generiert train.record- und test.record-Datei)
Neue Texteditor-Datei labelmap.pbtxt im Ordner \object_detection\training erstellen mit lable map:
item {
id: 1
name: 'nine'
}
item {
id: 2
name: 'ten'
}
item {
id: 3
name: 'ace'
}
...
faster_rcnn_inception_v2_pets.config-Datei aus Ordner \object_detection\samples\configs in Ordner \object_detection\training kopieren und im Texteditor bearbeiten:
Zeile 9: num_classes : 3
Zeile 106: fine_tune_checkpoint : "C:/tf/models/research/object_detection/faster_rcnn_inception_v2_coco_2018_01_28/model.ckpt"
Zeile 123/125: input_path : "C:/tf/models/research/object_detection/train.record"
label_map_path: "C:/tf/models/research/object_detection/training/labelmap.pbtxt"
Zeile 130: num_examples --> Anzahl der Bilder in \images\test
Zeile 135/137: input_path : "C:/tf/models/research/object_detection/test.record"
label_map_path: "C:/tf/models/research/object_detection/training/labelmap.pbtxt"
train.py-Datei aus Ordner \object_detection\legacy in Ordner \object_detection kopieren
python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config
(Training starten)
Trainieren lassen bis loss unter 0.05 liegt (bei SSD loss kleiner als 2)
tensorboard --logdir=training
((neues CMD-Fenster) Fortschritt anzeigen --> YourPCName:6006 im Browser)
Training abbrechen mit Strg+C (Checkpoint abwarten)