Skip to content

Commit

Permalink
Add darknet code dependences, base detection modele and make models c…
Browse files Browse the repository at this point in the history
…ompatiable with singa-auto
  • Loading branch information
nailixing committed Jun 1, 2020
1 parent 95d20b6 commit 778bc85
Show file tree
Hide file tree
Showing 11 changed files with 519 additions and 444 deletions.
28 changes: 28 additions & 0 deletions examples/models/image_object_detection/food101.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from singa_auto.darknet.food_objection_base_model import FoodDetectionBase
from keras.applications.xception import Xception


class FoodDetection101(FoodDetectionBase):

def __init__(self, **knobs):

super().__init__(clf_model_class_name=Xception, **knobs)

# pre config
self.classes = 101
self.image_size = 299

# preload files
self.yolo_cfg_name = "yolov3-food.cfg"
self.yolo_weight_name = "yolov3-food_final.weights"
self.food_name = "food.names"

# this is the model file downloaded from internet,
# can choose download locally and upload , or download from server
# if download at server side, leave it to none
self.preload_clf_model_weights_name = None

# this is the trained model
self.trained_clf_model_weights_name = "xception-F101-0.85.h5"

self._npy_index_name = "food101.npy"
27 changes: 27 additions & 0 deletions examples/models/image_object_detection/food172.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from keras.applications.xception import Xception
from singa_auto.darknet.food_objection_base_model import FoodDetectionBase


class FoodDetection172(FoodDetectionBase):

def __init__(self, **knobs):
super().__init__(clf_model_class_name=Xception, **knobs)

# pre config
self.classes = 172
self.image_size = 299

# preload files
self.yolo_cfg_name = "yolov3-food.cfg"
self.yolo_weight_name = "yolov3-food_final.weights"
self.food_name = "food.names"

# this is the model file downloaded from internet,
# can choose download locally and upload , or download from server
# if download at server side, leave it to none
self.preload_clf_model_weights_name = None

# this is the trained model
self.trained_clf_model_weights_name = "xception-800_F172-0.86.h5"

self._npy_index_name = "food172.npy"
27 changes: 27 additions & 0 deletions examples/models/image_object_detection/food231.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from keras.applications.xception import Xception
from singa_auto.darknet.food_objection_base_model import FoodDetectionBase


class FoodDetection231(FoodDetectionBase):

def __init__(self, **knobs):
super().__init__(clf_model_class_name=Xception, **knobs)

# pre config
self.classes = 231
self.image_size = 299

# preload files
self.yolo_cfg_name = "yolov3-food.cfg"
self.yolo_weight_name = "yolov3-food_final.weights"
self.food_name = "food.names"

# this is the model file downloaded from internet,
# can choose download locally and upload , or download from server
# if download at server side, leave it to none
self.preload_clf_model_weights_name = None

# this is the trained model
self.trained_clf_model_weights_name = "xception-food231-0-15-0.82.h5"

self._npy_index_name = "food231.npy"
27 changes: 27 additions & 0 deletions examples/models/image_object_detection/food256.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from keras.applications.inception_resnet_v2 import InceptionResNetV2
from singa_auto.darknet.food_objection_base_model import FoodDetectionBase


class FoodDetection256(FoodDetectionBase):

def __init__(self, **knobs):
super().__init__(clf_model_class_name=InceptionResNetV2, **knobs)

# pre config
self.classes = 256
self.image_size = 299

# preload files
self.yolo_cfg_name = "yolov3-food.cfg"
self.yolo_weight_name = "yolov3-food_final.weights"
self.food_name = "food.names"

# this is the model file downloaded from internet,
# can choose download locally and upload , or download from server
# if download at server side, leave it to none
self.preload_clf_model_weights_name = "inception_resnet_v2_weights_tf_dim_ordering_tf_kernels.h5"

# this is the trained model
self.trained_clf_model_weights_name = "inceptionresnet-U256-0.73.h5"

self._npy_index_name = "uec256.npy"
27 changes: 27 additions & 0 deletions examples/models/image_object_detection/food_55.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from keras.applications.inception_resnet_v2 import InceptionResNetV2
from singa_auto.darknet.food_objection_base_model import FoodDetectionBase


class FoodDetection55(FoodDetectionBase):

def __init__(self, **knobs):
super().__init__(clf_model_class_name=InceptionResNetV2, **knobs)

# pre config
self.classes = 55
self.image_size = 299

# preload files
self.yolo_cfg_name = "yolov3-food.cfg"
self.yolo_weight_name = "yolov3-food_final.weights"
self.food_name = "food.names"

# this is the model file downloaded from internet,
# can choose download locally and upload , or download from server
# if download at server side, leave it to none
self.preload_clf_model_weights_name = "inception_resnet_v2_weights_tf_dim_ordering_tf_kernels.h5"

# this is the trained model
self.trained_clf_model_weights_name = "inceptionresnet-FC55-0.86.h5"

self._npy_index_name = "food55.npy"
148 changes: 0 additions & 148 deletions examples/models/image_object_detection/food_darknet_xception.py

This file was deleted.

Loading

0 comments on commit 778bc85

Please sign in to comment.