Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
ViaResto-website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aymeric Chaumont
ViaResto-website
Commits
67eee02b
Commit
67eee02b
authored
2 years ago
by
Antoine Gaudron-Desjardins
Browse files
Options
Downloads
Patches
Plain Diff
lint
parent
b878018c
No related branches found
No related tags found
1 merge request
!54
fix artifacts vs cache
Pipeline
#44488
passed
2 years ago
Stage: install
Stage: test
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend/video_capture.py
+3
-1
3 additions, 1 deletion
backend/video_capture.py
with
3 additions
and
1 deletion
backend/video_capture.py
+
3
−
1
View file @
67eee02b
...
...
@@ -18,6 +18,7 @@ host = os.getenv('MODEL_HOST')
port
=
os
.
getenv
(
'
MODEL_PORT
'
)
model
=
os
.
getenv
(
'
MODEL_NAME
'
)
def
make_prediction
(
instances
):
url
=
f
"
http://
{
host
}
:
{
port
}
/v1/models/
{
model
}
:predict
"
data
=
json
.
dumps
({
"
signature_name
"
:
"
serving_default
"
,
"
instances
"
:
instances
.
tolist
()})
...
...
@@ -25,10 +26,11 @@ def make_prediction(instances):
json_response
=
requests
.
post
(
url
,
data
=
data
,
headers
=
headers
)
try
:
predictions
=
json
.
loads
(
json_response
.
text
)[
'
predictions
'
]
except
:
except
BaseException
:
print
(
"
prediction failed
"
)
return
predictions
async
def
handle_cameras
():
db
=
SessionLocal
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment