개정판 b64cc3b5
issue #1366: fix label training
DTI_PID/WebServer/app/recognition/index.py | ||
---|---|---|
60 | 60 |
data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)) + '\\..\\..\\symbol_training\\Data\\', data['name']) |
61 | 61 |
|
62 | 62 |
boxes = test_doftech_all_images.get_symbol(imgs, data['name'], root_path=data_path, trained_model1=os.path.join(data_path, 'checkpoint', data['name'] + "_only_params.pth"), \ |
63 |
trained_model2=None, save=True)
|
|
63 |
trained_model2=None, save=False)
|
|
64 | 64 |
|
65 | 65 |
return jsonify({'symbol_box': boxes[0]}) |
66 | 66 |
|
DTI_PID/WebServer/run.py | ||
---|---|---|
1 | 1 |
from app import app |
2 | 2 |
|
3 | 3 |
if __name__ == '__main__': |
4 |
app.run(port=8080, debug=True, host='0.0.0.0')
|
|
4 |
app.run(port=8080, debug=False, host='0.0.0.0')
|
|
5 | 5 |
#app.run(debug=False) |
DTI_PID/WebServer/symbol_training/src/doftech_dataset.py | ||
---|---|---|
34 | 34 |
for obj in annot.findall('object'): |
35 | 35 |
xmin, xmax, ymin, ymax = [int(obj.find('bndbox').find(tag).text) - 1 for tag in |
36 | 36 |
["xmin", "xmax", "ymin", "ymax"]] |
37 |
if obj.find('name').text.lower().strip() in self.classes: |
|
38 |
label = self.classes.index(obj.find('name').text.lower().strip()) |
|
37 |
#if obj.find('name').text.lower().strip() in self.classes: |
|
38 |
if obj.find('name').text in self.classes: |
|
39 |
#label = self.classes.index(obj.find('name').text.lower().strip()) |
|
40 |
label = self.classes.index(obj.find('name').text) |
|
39 | 41 |
objects.append([xmin, ymin, xmax, ymax, label]) |
40 | 42 |
continue |
41 | 43 |
if self.is_training: |
... | ... | |
84 | 86 |
for obj in annot.findall('object'): |
85 | 87 |
xmin, xmax, ymin, ymax = [int(obj.find('bndbox').find(tag).text) - 1 for tag in |
86 | 88 |
["xmin", "xmax", "ymin", "ymax"]] |
87 |
if obj.find('name').text.lower().strip() in self.classes: |
|
88 |
label = self.classes.index(obj.find('name').text.lower().strip()) |
|
89 |
#if obj.find('name').text.lower().strip() in self.classes: |
|
90 |
if obj.find('name').text in self.classes: |
|
91 |
#label = self.classes.index(obj.find('name').text.lower().strip()) |
|
92 |
label = self.classes.index(obj.find('name').text) |
|
89 | 93 |
objects.append([xmin, ymin, xmax, ymax, label]) |
90 | 94 |
continue |
91 | 95 |
if self.is_training: |
DTI_PID/WebServer/symbol_training/train.py | ||
---|---|---|
19 | 19 |
from src.vis_utils.vis_tool import visdom_bbox |
20 | 20 |
|
21 | 21 |
loss_data = {'X': [], 'Y': [], 'legend_U':['total', 'coord', 'conf', 'cls']} |
22 |
#visdom = visdom.Visdom(port='8080')
|
|
22 |
#visdom = visdom.Visdom(port='8088')
|
|
23 | 23 |
|
24 | 24 |
# 형상 CLASS |
25 | 25 |
DOFTECH_CLASSES= ['gate', 'globe', 'butterfly', 'check', 'ball', 'relief', |
... | ... | |
44 | 44 |
parser.add_argument("--decay", type=float, default=0.0005) |
45 | 45 |
parser.add_argument("--dropout", type=float, default=0.5) |
46 | 46 |
parser.add_argument("--num_epoches", type=int, default=205) |
47 |
parser.add_argument("--test_interval", type=int, default=10, help="Number of epoches between testing phases")
|
|
47 |
parser.add_argument("--test_interval", type=int, default=20, help="Number of epoches between testing phases")
|
|
48 | 48 |
parser.add_argument("--object_scale", type=float, default=1.0) |
49 | 49 |
parser.add_argument("--noobject_scale", type=float, default=0.5) |
50 | 50 |
parser.add_argument("--class_scale", type=float, default=1.0) |
내보내기 Unified diff