-
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.
- Loading branch information
0 parents
commit f97bf78
Showing
496 changed files
with
42,143 additions
and
0 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,16 @@ | ||
## Intro | ||
"КАПЛЯ" позволяет жителям домов, использующих услуги "КАПЛИ", снимать показания счетчиков с помощью фотографии и моментально получить счет для оплаты услуг водоснабжения. Необходимы сотрудники, готовые проверять истинные показания счетчиков. Эта необходимость появлялась при сомнительном/нелогичном изменении показаний счетчика относительно старых. Такая проверка предоставляется "КАПЛЕЙ". | ||
|
||
## Realization | ||
|
||
Была разработана микросервисная архитектура с регулировщиком нагрузки и изменением количеством ресурсов. | ||
|
||
Кросс-платформенное приложение с возможностью обмена информации с серверной частью. | ||
|
||
YOLO-подобная модель для определения показателей счетчиков по фотографии вне зависимости от освещения или же других осложняющих факторов. Была доработана архитектура увеличением показателей drop-out слоев, регулировкой сверток и увеличением полносвязных слоев. | ||
|
||
### Rep: | ||
- [api_ml](api_ml) папка с реализацией простой API для доступа к моделе и самой моделью | ||
- [backend](backend) папка с полной реализацией объединенного backend как для сайта, так и для кросс-платформенного приложения | ||
- [frontend](frontend) полный фронт для сайта | ||
- [mobile_dart_app](mobile_dart_app) реализация кросс-платформенного приложения для фотографий и связи с моделью |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+88.7 KB
...64a932ce63deb90b6702e355704fb0b69ea22c41eb7114bea2ab8555c2487f6db77bb3c0492.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,47 @@ | ||
## Intro | ||
|
||
Реализована простая API для доступа к yolo-подобной моделе компьютерного зрения. За основу была взята архитектура YOLOv7 с последующими доработками количества drop-out слоев и полносвязных слоев с измененными свертками для увеличения показателей точности вне зависимости от освещения фотографии. | ||
|
||
 | ||
|
||
## API | ||
======= | ||
# Легкая документация к беку | ||
_Каждый из роутов имеет метод post. Входные данные везде {"upload_image" : image, "token" : token}_ | ||
|
||
## Сами роуты | ||
- post('/all_values') : ответит в формате | ||
|
||
{"0": { | ||
"value": "0", | ||
"x": 0.29652777314186096, | ||
"y": 0.3941406309604645, | ||
"w": 0.0486111119389534, | ||
"h": 0.03984374925494194, | ||
"coef": 0.7717819809913635 | ||
}, ... | ||
} | ||
- post('/get_number'): ответит в формате | ||
{ | ||
"number": "00034327" | ||
} | ||
- post('/get_coordinates'): ответит в формате: | ||
|
||
{"0": { | ||
"value": "0", | ||
"x": 0.29652777314186096, | ||
"y": 0.3941406309604645, | ||
"w": 0.0486111119389534, | ||
"h": 0.03984374925494194 | ||
}, ... | ||
} | ||
|
||
## О репозитории | ||
К API составляющей веб-сервера относятся файлы [main.py](main.py), папки [apiUtils](apiUtils), [Content](Content) | ||
- в файле main.py запускается web-server, принимающий запросы на эндпоинты, описанные выше. Для поиска значений на | ||
картинках используется Neural Vision, соседствующее с веб-сервером. в файле [detect.py](detect.py) содержится функция | ||
- папка [apiUtils](apiUtils) содержит хешер для названия сохраняемых файлов фотографий счетчиков. файл other.py хранит | ||
функции, используемые для парсинга pandas Dataframe и проверки соответствия "коробки" dial со значениями с координатами значений (они должны быть внутри коробки dial) (см. [result.png](result.png)) | ||
|
||
При обновлении файлов в репозитории удаленный сервер с помощью автоскриптов обновляет его в себе, а также запускается вместе с машиной | ||
при ее перезапуске. |
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,11 @@ | ||
import passlib.context | ||
from passlib.hash import hex_sha512 as hex_sha512 | ||
|
||
|
||
class HasherClass: | ||
def __init__(self): | ||
self.ImageHasher = passlib.context.CryptContext(schemes=['sha512_crypt'], deprecated='auto') | ||
|
||
|
||
def CreateImageFileNameHash(self, FileName: str) -> str: | ||
return hex_sha512.hash(FileName)+"."+FileName.split(".")[1] # type: ignore |
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,3 @@ | ||
from apiUtils import Hasher, other | ||
|
||
__all__ = ["Hasher", "other"] |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,20 @@ | ||
const = 1 | ||
|
||
|
||
def dict_to_message(d): | ||
result = [] | ||
for key, value in d.items(): | ||
values = [str(value["value"]), str(value["x"]), str(value["y"]), str(value["w"]), str(value["h"]), | ||
str(value["coef"])] | ||
result.append(", ".join(values)) | ||
return "\n" + "\n".join(result) | ||
|
||
|
||
def check_area(prediction): | ||
try: | ||
for ID in range(len(prediction) - 1): | ||
if prediction.at[ID, 'h'] * prediction.at[ID, 'w'] > const: | ||
prediction.drop(index=ID) | ||
return prediction | ||
except TypeError: | ||
return TypeError |
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,22 @@ | ||
names: | ||
- '0' | ||
- '1' | ||
- '2' | ||
- '3' | ||
- '4' | ||
- '5' | ||
- '6' | ||
- '7' | ||
- '8' | ||
- '9' | ||
- dial | ||
nc: 11 | ||
roboflow: | ||
license: CC BY 4.0 | ||
project: waterpay_test1 | ||
url: https://universe.roboflow.com/egor-gruzintsev-xjx2u/waterpay_test1/dataset/1 | ||
version: 1 | ||
workspace: egor-gruzintsev-xjx2u | ||
test: ../test/images | ||
train: /content/datasets/WaterPay_test1-1/train/images | ||
val: /content/datasets/WaterPay_test1-1/valid/images |
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,110 @@ | ||
2023-02-16T19:21:31.894643+0400 0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
, 0, 0.3645833432674408, 0.3968749940395355, 0.04305555671453476, 0.04062499850988388, 0.7010836005210876 | ||
, 0, 0.42916667461395264, 0.39453125, 0.04444444552063942, 0.0390625, 0.769550085067749 | ||
, 3, 0.49444442987442017, 0.3941406309604645, 0.0416666679084301, 0.03984374925494194, 0.7755732536315918 | ||
, 4, 0.5604166388511658, 0.39140623807907104, 0.04027777910232544, 0.0390625, 0.72199547290802 | ||
, 3, 0.6298611164093018, 0.3929687440395355, 0.04027777910232544, 0.04062499850988388, 0.7452424168586731 | ||
, 2, 0.6951388716697693, 0.3949218690395355, 0.04305555671453476, 0.03671874850988388, 0.7411214709281921 | ||
, 7, 0.7597222328186035, 0.38593751192092896, 0.03888889029622078, 0.03281249850988388, 0.3667661249637604 | ||
, dial, 0.5270833373069763, 0.3929687440395355, 0.5319444537162781, 0.07968749850988388, 0.8313941359519958 | ||
|
||
2023-02-16T19:24:24.490869+0400 0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
, 0, 0.3645833432674408, 0.3968749940395355, 0.04305555671453476, 0.04062499850988388, 0.7010836005210876 | ||
, 0, 0.42916667461395264, 0.39453125, 0.04444444552063942, 0.0390625, 0.769550085067749 | ||
, 3, 0.49444442987442017, 0.3941406309604645, 0.0416666679084301, 0.03984374925494194, 0.7755732536315918 | ||
, 4, 0.5604166388511658, 0.39140623807907104, 0.04027777910232544, 0.0390625, 0.72199547290802 | ||
, 3, 0.6298611164093018, 0.3929687440395355, 0.04027777910232544, 0.04062499850988388, 0.7452424168586731 | ||
, 2, 0.6951388716697693, 0.3949218690395355, 0.04305555671453476, 0.03671874850988388, 0.7411214709281921 | ||
, 7, 0.7597222328186035, 0.38593751192092896, 0.03888889029622078, 0.03281249850988388, 0.3667661249637604 | ||
, dial, 0.5270833373069763, 0.3929687440395355, 0.5319444537162781, 0.07968749850988388, 0.8313941359519958 | ||
|
||
2023-02-17T23:40:29.585634+0400 0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
, 0, 0.3645833432674408, 0.3968749940395355, 0.04305555671453476, 0.04062499850988388, 0.7010836005210876 | ||
, 0, 0.42916667461395264, 0.39453125, 0.04444444552063942, 0.0390625, 0.769550085067749 | ||
, 3, 0.49444442987442017, 0.3941406309604645, 0.0416666679084301, 0.03984374925494194, 0.7755732536315918 | ||
, 4, 0.5604166388511658, 0.39140623807907104, 0.04027777910232544, 0.0390625, 0.72199547290802 | ||
, 3, 0.6298611164093018, 0.3929687440395355, 0.04027777910232544, 0.04062499850988388, 0.7452424168586731 | ||
, 2, 0.6951388716697693, 0.3949218690395355, 0.04305555671453476, 0.03671874850988388, 0.7411214709281921 | ||
, 7, 0.7597222328186035, 0.38593751192092896, 0.03888889029622078, 0.03281249850988388, 0.3667661249637604 | ||
, dial, 0.5270833373069763, 0.3929687440395355, 0.5319444537162781, 0.07968749850988388, 0.8313941359519958 | ||
|
||
2023-02-17T23:46:40.116756+0400 | ||
0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
0, 0.3645833432674408, 0.3968749940395355, 0.04305555671453476, 0.04062499850988388, 0.7010836005210876 | ||
0, 0.42916667461395264, 0.39453125, 0.04444444552063942, 0.0390625, 0.769550085067749 | ||
3, 0.49444442987442017, 0.3941406309604645, 0.0416666679084301, 0.03984374925494194, 0.7755732536315918 | ||
4, 0.5604166388511658, 0.39140623807907104, 0.04027777910232544, 0.0390625, 0.72199547290802 | ||
3, 0.6298611164093018, 0.3929687440395355, 0.04027777910232544, 0.04062499850988388, 0.7452424168586731 | ||
2, 0.6951388716697693, 0.3949218690395355, 0.04305555671453476, 0.03671874850988388, 0.7411214709281921 | ||
7, 0.7597222328186035, 0.38593751192092896, 0.03888889029622078, 0.03281249850988388, 0.3667661249637604 | ||
dial, 0.5270833373069763, 0.3929687440395355, 0.5319444537162781, 0.07968749850988388, 0.8313941359519958 | ||
2023-02-17T23:49:41.160882+0400 | ||
0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
0, 0.3645833432674408, 0.3968749940395355, 0.04305555671453476, 0.04062499850988388, 0.7010836005210876 | ||
0, 0.42916667461395264, 0.39453125, 0.04444444552063942, 0.0390625, 0.769550085067749 | ||
3, 0.49444442987442017, 0.3941406309604645, 0.0416666679084301, 0.03984374925494194, 0.7755732536315918 | ||
4, 0.5604166388511658, 0.39140623807907104, 0.04027777910232544, 0.0390625, 0.72199547290802 | ||
3, 0.6298611164093018, 0.3929687440395355, 0.04027777910232544, 0.04062499850988388, 0.7452424168586731 | ||
2, 0.6951388716697693, 0.3949218690395355, 0.04305555671453476, 0.03671874850988388, 0.7411214709281921 | ||
7, 0.7597222328186035, 0.38593751192092896, 0.03888889029622078, 0.03281249850988388, 0.3667661249637604 | ||
dial, 0.5270833373069763, 0.3929687440395355, 0.5319444537162781, 0.07968749850988388, 0.8313941359519958 | ||
2023-02-17T23:52:36.085900+0400 | ||
0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
0, 0.3645833432674408, 0.3968749940395355, 0.04305555671453476, 0.04062499850988388, 0.7010836005210876 | ||
0, 0.42916667461395264, 0.39453125, 0.04444444552063942, 0.0390625, 0.769550085067749 | ||
3, 0.49444442987442017, 0.3941406309604645, 0.0416666679084301, 0.03984374925494194, 0.7755732536315918 | ||
4, 0.5604166388511658, 0.39140623807907104, 0.04027777910232544, 0.0390625, 0.72199547290802 | ||
3, 0.6298611164093018, 0.3929687440395355, 0.04027777910232544, 0.04062499850988388, 0.7452424168586731 | ||
2, 0.6951388716697693, 0.3949218690395355, 0.04305555671453476, 0.03671874850988388, 0.7411214709281921 | ||
7, 0.7597222328186035, 0.38593751192092896, 0.03888889029622078, 0.03281249850988388, 0.3667661249637604 | ||
dial, 0.5270833373069763, 0.3929687440395355, 0.5319444537162781, 0.07968749850988388, 0.8313941359519958 | ||
2023-02-17T23:52:48.718988+0400 | ||
0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
0, 0.3645833432674408, 0.3968749940395355, 0.04305555671453476, 0.04062499850988388, 0.7010836005210876 | ||
0, 0.42916667461395264, 0.39453125, 0.04444444552063942, 0.0390625, 0.769550085067749 | ||
3, 0.49444442987442017, 0.3941406309604645, 0.0416666679084301, 0.03984374925494194, 0.7755732536315918 | ||
4, 0.5604166388511658, 0.39140623807907104, 0.04027777910232544, 0.0390625, 0.72199547290802 | ||
3, 0.6298611164093018, 0.3929687440395355, 0.04027777910232544, 0.04062499850988388, 0.7452424168586731 | ||
2, 0.6951388716697693, 0.3949218690395355, 0.04305555671453476, 0.03671874850988388, 0.7411214709281921 | ||
7, 0.7597222328186035, 0.38593751192092896, 0.03888889029622078, 0.03281249850988388, 0.3667661249637604 | ||
dial, 0.5270833373069763, 0.3929687440395355, 0.5319444537162781, 0.07968749850988388, 0.8313941359519958 | ||
2023-03-01T01:43:27.783221+0400 | ||
0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
2023-03-01T01:45:12.073309+0400 | ||
0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
2023-03-01T01:45:16.295359+0400 | ||
0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
2023-03-01T01:45:59.223681+0400 | ||
0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
2023-03-01T01:46:36.178468+0400 | ||
0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
2023-03-01T01:48:02.599623+0400 | ||
0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
2023-03-01T01:48:24.512239+0400 | ||
0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
2023-03-01T01:59:03.571549+0400 | ||
0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
2023-03-01T02:01:47.275710+0400 | ||
0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
2023-03-01T09:25:15.216198+0400 | ||
0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
2023-03-01T09:26:34.448086+0400 | ||
0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
0, 0.3645833432674408, 0.3968749940395355, 0.04305555671453476, 0.04062499850988388, 0.7010836005210876 | ||
0, 0.42916667461395264, 0.39453125, 0.04444444552063942, 0.0390625, 0.769550085067749 | ||
3, 0.49444442987442017, 0.3941406309604645, 0.0416666679084301, 0.03984374925494194, 0.7755732536315918 | ||
4, 0.5604166388511658, 0.39140623807907104, 0.04027777910232544, 0.0390625, 0.72199547290802 | ||
3, 0.6298611164093018, 0.3929687440395355, 0.04027777910232544, 0.04062499850988388, 0.7452424168586731 | ||
2, 0.6951388716697693, 0.3949218690395355, 0.04305555671453476, 0.03671874850988388, 0.7411214709281921 | ||
7, 0.7597222328186035, 0.38593751192092896, 0.03888889029622078, 0.03281249850988388, 0.3667661249637604 | ||
dial, 0.5270833373069763, 0.3929687440395355, 0.5319444537162781, 0.07968749850988388, 0.8313941359519958 | ||
2023-03-01T09:26:56.358222+0400 | ||
0, 0.29652777314186096, 0.3941406309604645, 0.0486111119389534, 0.03984374925494194, 0.7717819809913635 | ||
0, 0.3645833432674408, 0.3968749940395355, 0.04305555671453476, 0.04062499850988388, 0.7010836005210876 | ||
0, 0.42916667461395264, 0.39453125, 0.04444444552063942, 0.0390625, 0.769550085067749 | ||
3, 0.49444442987442017, 0.3941406309604645, 0.0416666679084301, 0.03984374925494194, 0.7755732536315918 | ||
4, 0.5604166388511658, 0.39140623807907104, 0.04027777910232544, 0.0390625, 0.72199547290802 | ||
3, 0.6298611164093018, 0.3929687440395355, 0.04027777910232544, 0.04062499850988388, 0.7452424168586731 | ||
2, 0.6951388716697693, 0.3949218690395355, 0.04305555671453476, 0.03671874850988388, 0.7411214709281921 | ||
7, 0.7597222328186035, 0.38593751192092896, 0.03888889029622078, 0.03281249850988388, 0.3667661249637604 | ||
dial, 0.5270833373069763, 0.3929687440395355, 0.5319444537162781, 0.07968749850988388, 0.8313941359519958 |
Oops, something went wrong.