Skip to content

Commit

Permalink
Merge pull request #19 from 5sControl/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
eugenos-programos authored Jul 19, 2023
2 parents 04f099c + 294c80b commit 7086b56
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
.vscode/
*.env
test.py
*.pt

storage.googleapis.com
runs/*
Expand Down
15 changes: 14 additions & 1 deletion confs/settings.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ extra = '
{
"itemId": 39,
"itemName": "tea",
"multiRow": false,
"task": "bottles",
"lowStockLevel": 20,
"coords": [
Expand All @@ -20,6 +19,20 @@ extra = '
"y2": 464.53088357256775
}
]
},
{
"itemId": 28,
"itemName": "tea",
"task": "red lines",
"lowStockLevel": 10,
"coords": [
{
"x1": 495.8731636363636,
"x2": 1417.4731636363636,
"y1": 186.89133014354067,
"y2": 464.53088357256775
}
]
}
],
"zones": []
Expand Down
2 changes: 1 addition & 1 deletion min_max_utils/MinMaxReporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def create_report(self, n_boxes_history: list, img: np.array, areas: list, boxes
report.append(zone_dict)
for item_index, item in enumerate(areas):
itemid = item['itemId']
multi_row = item['multiRow']
multi_row = item['task'] == 'red lines'

item_name = item['itemName']
user_dbg_image_name_url = self.user_folder + '/' + str(uuid.uuid4()) + '.png'
Expand Down
3 changes: 2 additions & 1 deletion model_image/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
app = Flask(__name__)
human_model = ObjDetectionModel(HUMAN_MODEL_PATH, CONF_THRES, IOU_THRES, CLASSES)
box_model = ObjDetectionModel(BOX_MODEL_PATH, CONF_THRES, IOU_THRES, CLASSES)
bottle_model = ObjDetectionModel(BOTTLE_MODEL_PATH, CONF_THRES, IOU_THRES, CLASSES)


logger = logging.getLogger('min_max_logger')
Expand Down Expand Up @@ -56,7 +57,7 @@ def predict_boxes():
def predict_bottles():
if request.method == 'POST':
image = np.array(request.json['image']).astype(np.float32)
n_bottles, coords = human_model(image, classes=[39])
n_bottles, coords = bottle_model(image)
logger.info("Request to predict_bottles: " + str(n_bottles))
return jsonify(
{
Expand Down
1 change: 1 addition & 0 deletions model_image/flask_configs/flask_confs.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"conf_thres": 0.46,
"box_detect_model": "min_max_v0.3.10.pt",
"human_detect_model": "min_max_v1.0h.pt",
"bottle_detect_model": "min_max_v0.4.3b.pt",
"img_size": 640,
"port": 5000
}
1 change: 1 addition & 0 deletions model_image/flask_configs/load_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
IOU_THRES = configs.get("iou_thres")
BOX_MODEL_PATH = configs.get("box_detect_model")
HUMAN_MODEL_PATH = configs.get("human_detect_model")
BOTTLE_MODEL_PATH = configs.get("bottle_detect_model")
CLASSES = configs.get("classes")
IMG_SIZE = configs.get("img_size")
PORT = configs.get("port")
2 changes: 1 addition & 1 deletion model_image/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ pydantic==1.10.2
python-dotenv==1.0.0
PyYAML==6.0
requests==2.27.1
ultralytics==8.0.112
ultralytics==8.0.136
Flask==2.2.2

0 comments on commit 7086b56

Please sign in to comment.