forked from nusdbsystem/singa-auto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nusdbsystem#74 from naili-xing/dev
Add detection base model
- Loading branch information
Showing
11 changed files
with
519 additions
and
444 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
148
examples/models/image_object_detection/food_darknet_xception.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.