sciveo 0.1.51__tar.gz → 0.1.52__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sciveo-0.1.51 → sciveo-0.1.52}/PKG-INFO +2 -2
- sciveo-0.1.52/sciveo/api/predictors.py +46 -0
- sciveo-0.1.52/sciveo/api/server.py +77 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/cli.py +12 -1
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/tools/nvr.py +2 -1
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/nlp/embeddings.py +1 -1
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/configuration.py +5 -0
- sciveo-0.1.52/sciveo/version.py +2 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo.egg-info/PKG-INFO +2 -2
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo.egg-info/SOURCES.txt +2 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo.egg-info/requires.txt +10 -6
- {sciveo-0.1.51 → sciveo-0.1.52}/setup.py +7 -2
- sciveo-0.1.51/sciveo/version.py +0 -2
- {sciveo-0.1.51 → sciveo-0.1.52}/README.md +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/api/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/api/base.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/api/upload.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/common/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/common/configuration.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/common/model.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/common/optimizers.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/common/sampling.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/content/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/content/dataset.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/content/experiment.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/content/project.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/content/runner.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/ml/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/ml/base.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/ml/encoders/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/ml/encoders/base.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/ml/encoders/normalizer.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/ml/nlp/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/ml/nlp/search.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/ml/time_series/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/ml/time_series/dataset.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/ml/time_series/predictor.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/ml/time_series/trainer.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/ml/time_series/window_generator.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/base.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/job_daemon.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/layouts/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/layouts/base.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/pipeline.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/postprocessors/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/postprocessors/base.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/postprocessors/default.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/audio/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/audio/audio.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/audio/audio_extractor_process.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/aws.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/base.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/file/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/file/archive.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/image/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/image/album.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/image/album_in_image.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/image/depth_esimation.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/image/embeddings.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/image/filters.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/image/generators.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/image/histogram.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/image/mask.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/image/object_detection.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/image/resize.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/image/segmentation.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/image/watermark.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/media_info.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/nlp/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/nlp/address.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/qr.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/sci/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/sci/base.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/sci/dataset.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/sci/time_series/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/sci/time_series/predictor.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/sci/time_series/trainer.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/tpu_base.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/video/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/video/generators.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/video/motion_detection.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/video/resize.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/video/video_album.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/video/video_frames.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/video/video_resample.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/queues.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/server.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/web/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/web/server.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/tools/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/base.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/dataset/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/dataset/object_detection.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/evaluation/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/evaluation/object_detection.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/images/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/images/base.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/images/description.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/images/embeddings.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/images/object_detection.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/images/segmentation.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/images/tools.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/images/transformers.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/nlp/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/nlp/tokenizers/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/nlp/tokenizers/bpe.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/video/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/ml/video/description.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/monitoring/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/monitoring/monitor.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/monitoring/start.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/monitoring/watchdog/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/monitoring/watchdog/memory.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/network/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/network/camera.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/network/sniffer.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/network/tools.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/array.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/aws/__init__.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/aws/priority_queue.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/aws/s3.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/common.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/complexity.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/compress.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/crypto.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/daemon.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/formating.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/hardware.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/http.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/logger.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/os.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/queue.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/random.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/remote.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/simple_counter.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/synchronized.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo/tools/timers.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo.egg-info/dependency_links.txt +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo.egg-info/entry_points.txt +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/sciveo.egg-info/top_level.txt +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/setup.cfg +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/test/test_complexity.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/test/test_compress.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/test/test_configuration.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/test/test_crypto.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/test/test_ml_datasets.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/test/test_monitoring.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/test/test_runner.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/test/test_sampling.py +0 -0
- {sciveo-0.1.51 → sciveo-0.1.52}/test/test_tokenizers.py +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sciveo
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.52
|
|
4
4
|
Description-Content-Type: text/markdown
|
|
5
5
|
Provides-Extra: mon
|
|
6
6
|
Provides-Extra: net
|
|
7
|
+
Provides-Extra: server
|
|
7
8
|
Provides-Extra: media
|
|
8
|
-
Provides-Extra: media-server
|
|
9
9
|
Provides-Extra: media-ml
|
|
10
10
|
Provides-Extra: all
|
|
11
11
|
Provides-Extra: media-all
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Pavlin Georgiev, Softel Labs
|
|
3
|
+
#
|
|
4
|
+
# This is a proprietary file and may not be copied,
|
|
5
|
+
# distributed, or modified without express permission
|
|
6
|
+
# from the owner. For licensing inquiries, please
|
|
7
|
+
# contact pavlin@softel.bg.
|
|
8
|
+
#
|
|
9
|
+
# 2023
|
|
10
|
+
#
|
|
11
|
+
|
|
12
|
+
from sciveo.tools.logger import *
|
|
13
|
+
from sciveo.tools.timers import Timer
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class Predictors:
|
|
17
|
+
def __init__(self, predictors=None):
|
|
18
|
+
if predictors is not None:
|
|
19
|
+
self.list_predictors = predictors
|
|
20
|
+
else:
|
|
21
|
+
from sciveo.ml.images.embeddings import ImageEmbedding
|
|
22
|
+
from sciveo.ml.nlp.embeddings import TextEmbedding
|
|
23
|
+
self.list_predictors = {
|
|
24
|
+
"TextEmbedding": TextEmbedding(),
|
|
25
|
+
"ImageEmbedding": ImageEmbedding(),
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
self.stats = {}
|
|
29
|
+
|
|
30
|
+
def predict(self, predictor_name, X):
|
|
31
|
+
t = Timer()
|
|
32
|
+
predicted = self.list_predictors[predictor_name].predict(X)
|
|
33
|
+
self.stats.setdefault(predictor_name, {"elapsed": 0.0, "count": 0})
|
|
34
|
+
self.stats[predictor_name]["elapsed"] += t.stop()
|
|
35
|
+
self.stats[predictor_name]["count"] += len(X)
|
|
36
|
+
return predicted
|
|
37
|
+
|
|
38
|
+
def describe(self):
|
|
39
|
+
result = []
|
|
40
|
+
for k, v in self.list_predictors.items():
|
|
41
|
+
result.append([k, v.describe(), self.stats.get(k, "")])
|
|
42
|
+
return result
|
|
43
|
+
|
|
44
|
+
def print(self):
|
|
45
|
+
for k, v in self.list_predictors.items():
|
|
46
|
+
info("predictor", k, v.describe())
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Pavlin Georgiev, Softel Labs
|
|
3
|
+
#
|
|
4
|
+
# This is a proprietary file and may not be copied,
|
|
5
|
+
# distributed, or modified without express permission
|
|
6
|
+
# from the owner. For licensing inquiries, please
|
|
7
|
+
# contact pavlin@softel.bg.
|
|
8
|
+
#
|
|
9
|
+
# 2023
|
|
10
|
+
#
|
|
11
|
+
|
|
12
|
+
import os
|
|
13
|
+
import time
|
|
14
|
+
from flask import Flask, jsonify, render_template, request, url_for, Response, abort
|
|
15
|
+
from waitress import serve
|
|
16
|
+
|
|
17
|
+
from sciveo.tools.logger import *
|
|
18
|
+
from sciveo.tools.daemon import DaemonBase
|
|
19
|
+
from sciveo.tools.timers import Timer
|
|
20
|
+
from sciveo.tools.compress import CompressJsonData
|
|
21
|
+
from sciveo.tools.configuration import GlobalConfiguration
|
|
22
|
+
from sciveo.api.predictors import Predictors
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
CONFIG = GlobalConfiguration.get()
|
|
26
|
+
SCI_API_AUTH_TOKEN = CONFIG["api_auth_token"]
|
|
27
|
+
SCI_API_PREFIX = CONFIG["api_prefix"]
|
|
28
|
+
|
|
29
|
+
API_PREDICTORS = Predictors(CONFIG.data.get("API_PREDICTORS", None))
|
|
30
|
+
API_PREDICTORS.print()
|
|
31
|
+
|
|
32
|
+
app = Flask(__name__)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def authenticate():
|
|
36
|
+
token = request.headers.get('Authorization')
|
|
37
|
+
if token != f"Bearer {SCI_API_AUTH_TOKEN}":
|
|
38
|
+
abort(401, 'Unauthorized')
|
|
39
|
+
|
|
40
|
+
@app.before_request
|
|
41
|
+
def before_request_func():
|
|
42
|
+
authenticate()
|
|
43
|
+
|
|
44
|
+
@app.route(f'/{SCI_API_PREFIX}/predict', methods=['POST'])
|
|
45
|
+
def predict_endpoint():
|
|
46
|
+
result = {"error": "invalid data"}
|
|
47
|
+
try:
|
|
48
|
+
if request.is_json:
|
|
49
|
+
data = request.json
|
|
50
|
+
if "predictor" in data and "X" in data:
|
|
51
|
+
t = Timer()
|
|
52
|
+
predicted = API_PREDICTORS.predict(data["predictor"], data["X"])
|
|
53
|
+
|
|
54
|
+
if data.get("compressed", 0) > 0:
|
|
55
|
+
predicted = CompressJsonData().compress(predicted)
|
|
56
|
+
|
|
57
|
+
result = {
|
|
58
|
+
data["predictor"]: predicted,
|
|
59
|
+
"stats": {
|
|
60
|
+
"elapsed": t.stop(),
|
|
61
|
+
"count": len(data["X"])
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
except Exception as e:
|
|
65
|
+
exception("predict_endpoint", e)
|
|
66
|
+
return jsonify(result)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class WebServerDaemon(DaemonBase):
|
|
70
|
+
def __init__(self, host="0.0.0.0", port=8901):
|
|
71
|
+
super().__init__()
|
|
72
|
+
self.host = host
|
|
73
|
+
self.port = port
|
|
74
|
+
|
|
75
|
+
def run(self):
|
|
76
|
+
info("run", [self.host, self.port])
|
|
77
|
+
serve(app, host=self.host, port=self.port)
|
|
@@ -26,7 +26,7 @@ def main():
|
|
|
26
26
|
parser.add_argument(
|
|
27
27
|
'command',
|
|
28
28
|
choices=[
|
|
29
|
-
'init', 'monitor', 'scan', 'nvr',
|
|
29
|
+
'init', 'monitor', 'scan', 'nvr', 'predictors-server',
|
|
30
30
|
'media-server', 'media-run',
|
|
31
31
|
'watchdog'
|
|
32
32
|
],
|
|
@@ -99,6 +99,17 @@ def main():
|
|
|
99
99
|
daemon.start()
|
|
100
100
|
while(True):
|
|
101
101
|
time.sleep(3600)
|
|
102
|
+
elif args.command == 'predictors-server':
|
|
103
|
+
GlobalConfiguration.set("API_PREDICTORS", None)
|
|
104
|
+
from sciveo.api.server import WebServerDaemon
|
|
105
|
+
daemons = [
|
|
106
|
+
WebServerDaemon(port=args.port)
|
|
107
|
+
]
|
|
108
|
+
for daemon in daemons:
|
|
109
|
+
debug("starting", type(daemon).__name__)
|
|
110
|
+
daemon.start()
|
|
111
|
+
while(True):
|
|
112
|
+
time.sleep(3600)
|
|
102
113
|
else:
|
|
103
114
|
warning(args.command, "not implemented")
|
|
104
115
|
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
#
|
|
11
11
|
|
|
12
12
|
import os
|
|
13
|
+
import shutil
|
|
13
14
|
import subprocess as sp
|
|
14
15
|
import time
|
|
15
16
|
import re
|
|
@@ -131,7 +132,7 @@ class VideoRecorder:
|
|
|
131
132
|
|
|
132
133
|
debug("MV", file_path, "=>", video_file_path)
|
|
133
134
|
os.makedirs(video_base_path, exist_ok=True)
|
|
134
|
-
|
|
135
|
+
shutil.move(file_path, video_file_path)
|
|
135
136
|
|
|
136
137
|
def clean_old_videos(self):
|
|
137
138
|
try:
|
|
@@ -23,7 +23,6 @@ import numpy as np
|
|
|
23
23
|
import pandas as pd
|
|
24
24
|
|
|
25
25
|
from transformers import AutoTokenizer, AutoModel
|
|
26
|
-
from sentence_transformers import SentenceTransformer
|
|
27
26
|
|
|
28
27
|
from sciveo.tools.logger import *
|
|
29
28
|
from sciveo.ml.base import BaseML
|
|
@@ -140,6 +139,7 @@ class SentenceEmbedding(TextEmbedding):
|
|
|
140
139
|
|
|
141
140
|
def init(self):
|
|
142
141
|
if self.model is None:
|
|
142
|
+
from sentence_transformers import SentenceTransformer
|
|
143
143
|
self.model = SentenceTransformer(self.model_name).to(self.device)
|
|
144
144
|
self.post_init()
|
|
145
145
|
|
|
@@ -41,6 +41,11 @@ class GlobalConfiguration:
|
|
|
41
41
|
GlobalConfiguration.config = GlobalConfiguration(name)
|
|
42
42
|
return GlobalConfiguration.config
|
|
43
43
|
|
|
44
|
+
@staticmethod
|
|
45
|
+
def set(k, v):
|
|
46
|
+
with GlobalConfiguration.lock_config:
|
|
47
|
+
GlobalConfiguration.config.data[k] = v
|
|
48
|
+
|
|
44
49
|
def __getitem__(self, key):
|
|
45
50
|
key = key.lower()
|
|
46
51
|
return self.data.get(key, self.default.get(key, None))
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sciveo
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.52
|
|
4
4
|
Description-Content-Type: text/markdown
|
|
5
5
|
Provides-Extra: mon
|
|
6
6
|
Provides-Extra: net
|
|
7
|
+
Provides-Extra: server
|
|
7
8
|
Provides-Extra: media
|
|
8
|
-
Provides-Extra: media-server
|
|
9
9
|
Provides-Extra: media-ml
|
|
10
10
|
Provides-Extra: all
|
|
11
11
|
Provides-Extra: media-all
|
|
@@ -46,8 +46,10 @@ tqdm>=0.0.0
|
|
|
46
46
|
ffmpeg-python>=0.0.0
|
|
47
47
|
opencv-python-headless>=0.0.0
|
|
48
48
|
opencv-contrib-python-headless>=0.0.0
|
|
49
|
-
fastapi
|
|
50
|
-
uvicorn[standard]
|
|
49
|
+
fastapi>=0.0.0
|
|
50
|
+
uvicorn[standard]>=0.0.0
|
|
51
|
+
flask>=0.0.0
|
|
52
|
+
waitress>=0.0.0
|
|
51
53
|
tensorflow>=0.0.0
|
|
52
54
|
keras>=0.0.0
|
|
53
55
|
torch>=0.0.0
|
|
@@ -71,13 +73,15 @@ accelerate>=0.0.0
|
|
|
71
73
|
annoy>=0.0.0
|
|
72
74
|
ultralytics>=0.0.0
|
|
73
75
|
|
|
74
|
-
[media-server]
|
|
75
|
-
fastapi
|
|
76
|
-
uvicorn[standard]
|
|
77
|
-
|
|
78
76
|
[mon]
|
|
79
77
|
psutil>=0.0.0
|
|
80
78
|
|
|
81
79
|
[net]
|
|
82
80
|
netifaces>=0.0.0
|
|
83
81
|
scapy>=0.0.0
|
|
82
|
+
|
|
83
|
+
[server]
|
|
84
|
+
fastapi>=0.0.0
|
|
85
|
+
uvicorn[standard]>=0.0.0
|
|
86
|
+
flask>=0.0.0
|
|
87
|
+
waitress>=0.0.0
|
|
@@ -20,12 +20,17 @@ extras_require = {
|
|
|
20
20
|
'netifaces>=0.0.0',
|
|
21
21
|
'scapy>=0.0.0',
|
|
22
22
|
],
|
|
23
|
+
'server': [
|
|
24
|
+
'fastapi>=0.0.0',
|
|
25
|
+
'uvicorn[standard]>=0.0.0',
|
|
26
|
+
'flask>=0.0.0',
|
|
27
|
+
'waitress>=0.0.0',
|
|
28
|
+
],
|
|
23
29
|
'media': [
|
|
24
30
|
'scikit-learn>=0.0.0', 'scipy>=0.0.0', 'scikit-video>=0.0.0', 'scikit-image>=0.0.0', 'pycryptodome>=0.0.0', 'exifread>=0.0.0', 'qrcode[pil]>=0.0.0',
|
|
25
31
|
'boto3', 'pandas>=0.0.0', 'pika>=0.0.0', 'regex>=0.0.0', 'matplotlib>=0.0.0', 'joblib>=0.0.0', 'tqdm>=0.0.0',
|
|
26
32
|
'ffmpeg-python>=0.0.0', 'opencv-python-headless>=0.0.0', 'opencv-contrib-python-headless>=0.0.0',
|
|
27
33
|
],
|
|
28
|
-
'media-server': ['fastapi', 'uvicorn[standard]'],
|
|
29
34
|
'media-ml': [
|
|
30
35
|
'tensorflow>=0.0.0', 'keras>=0.0.0',
|
|
31
36
|
'torch>=0.0.0', 'torchvision>=0.0.0',
|
|
@@ -35,7 +40,7 @@ extras_require = {
|
|
|
35
40
|
}
|
|
36
41
|
|
|
37
42
|
extras_require['all'] = extras_require['mon'] + extras_require['net']
|
|
38
|
-
extras_require['media-all'] = extras_require['all'] + extras_require['media'] + extras_require['
|
|
43
|
+
extras_require['media-all'] = extras_require['all'] + extras_require['media'] + extras_require['server'] + extras_require['media-ml']
|
|
39
44
|
|
|
40
45
|
setup(
|
|
41
46
|
name='sciveo',
|
sciveo-0.1.51/sciveo/version.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/audio/audio_extractor_process.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/sci/time_series/__init__.py
RENAMED
|
File without changes
|
{sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/sci/time_series/predictor.py
RENAMED
|
File without changes
|
{sciveo-0.1.51 → sciveo-0.1.52}/sciveo/media/pipelines/processors/sci/time_series/trainer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|