@keestalkstech/

NeedyRealisticListener

Python

No description

fork
loading
Files
  • main.py
main.py
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import json

class objdict(dict):
    def __getattr__(self, name):
        if name in self:
            return self[name]
        else:
            raise AttributeError("No such attribute: " + name)

    def __setattr__(self, name, value):
        self[name] = value

    def __delattr__(self, name):
        if name in self:
            del self[name]
        else:
            raise AttributeError("No such attribute: " + name)

    

x = """{  
   "settings":{  
      "version":"1.1.2",
      "lambda_folder":"blaze-dam-asset-classification",
      "lambda_bucket":"",
      "kafka_bootstrap_servers":"",
      "kafka_topic":"dam-asset-classification",
      "color_classification_amount":6
   },
   "models":[  
      {  
         "tag":"fashion-image-type",
         "version":"10_class_keras_xception02_98_99.h5",
         "classes":[  
            "model_back_crop",
            "model_back_full",
            "model_crop_detail",
            "model_front_crop",
            "model_front_full",
            "product_back",
            "product_detail",
            "product_front",
            "product_side",
            "theme_images"
         ]
      },
      {  
         "tag":"home-living-image-type",
         "version":"13_class_keras_xception01_94_92.h5",
         "classes":[  
            "dimensions",
            "product_back",
            "product_bottom",
            "product_detail",
            "product_front",
            "product_plus_front",
            "product_plus_slanted",
            "product_plus_top",
            "product_side",
            "product_slanted",
            "product_top",
            "tags",
            "theme_images"
         ]
      }
   ]
}"""

y = json.loads(x)

def get_model(tag):
  for model in y['models']:
    if model['tag'] == tag:
      return model

model = get_model('home-living-image-type')
print(model)


version = 'kaas.v1.0.20.h5'
v= version.split('.')
v[-2] = str(int(v[-2])+1)
print(v)
print('.'.join(v))