Skip to content

Commit

Permalink
feat: add fall detection icon in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivelin Ivanov authored Aug 3, 2021
2 parents 011fdad + dc93969 commit 934231c
Show file tree
Hide file tree
Showing 12 changed files with 587 additions and 81 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ cypress/screenshots/

# Test coverage reports
.nyc_output/
coverage/
coverage/
.env
38 changes: 19 additions & 19 deletions cypress/integration/ambianic-tests/timeline.spec.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
/// <reference types="cypress" />

context('Timeline', () => {
before(() => {
cy.visit('http://localhost:8080')
// cy.get('[data-cy=timeline]').click()
cy.visit("./timeline")
})
before(() => {
cy.visit('http://localhost:8080')
// cy.get('[data-cy=timeline]').click()
cy.visit("./timeline")
})

it('Should browse to timeline', () => {
cy.url().should('include', '/timeline')
})
it('Should browse to timeline', () => {
cy.url().should('include', '/timeline')
})

// Try to get this to work once we have mock data
// Try to get this to work once we have mock data

// it('Get timeline data', () => {
// cy.get('[data-cy=timelinedata]').then(($result) => {
// console.log($result)
// })
// })
// it('Get timeline data', () => {
// cy.get('[data-cy=timelinedata]').then(($result) => {
// console.log($result)
// })
// })

// it('Should generate no results in timeline', () => {
// cy.get('[data-cy=timeline]').click()
// it('Should generate no results in timeline', () => {
// cy.get('[data-cy=timeline]').click()

// cy.wait(5000)
// cy.wait(5000)

// cy.get('.infinite-status-prompt').contains('No results :(')
// })
// cy.get('.infinite-status-prompt').contains('No results :(')
// })
})
2 changes: 2 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
href="https://fonts.googleapis.com/css?display=swap&family=Roboto:300,400,500,700|Material+Icons"
rel="stylesheet preconnect "
/>

<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=5, user-scalable=yes, minimal-ui"
Expand All @@ -26,6 +27,7 @@
name="description"
content="Ambianic UI progressive web application to manage Ambianic Edge devices"
/>
<script src="https://code.iconify.design/1/1.0.7/iconify.min.js"></script>
</head>
<body>
<noscript>
Expand Down
36 changes: 35 additions & 1 deletion public/sample-data/timeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"image_file_name": "20191028-000051.322407.jpg",
"thumbnail_file_name": "20191028-000051.322407-thumbnail.jpg",
"inference_meta": {
"display": "Object Detection"
"display": "Fall Detection"
},
"inference_result": [
{
Expand All @@ -35,6 +35,40 @@
"pathname": "/workspace/src/ambianic/pipeline/store.py"
}
},
{
"args": {
"datetime": "2019-10-28T00:00:51.322407",
"id": "dd6705eb9730450098a5ade4c0af38fd",
"image_file_name": "20191028-000051.322407.jpg",
"thumbnail_file_name": "20191028-000051.322407-thumbnail.jpg",
"inference_meta": {
"display": "Fall Detection"
},
"inference_result": [
{
"box": {
"xmin": 0.6749029159545898,
"ymin": 0.024479886516928673,
"xmax": 0.9028397798538208,
"ymax": 0.4697817265987396
},
"confidence": 0.98828125,
"label": "fall"
}
],
"json_file_name": "20191028-000051.322407.json",
"rel_dir": "detections/20191028-000048.435604"
},
"created": 1572220851.3650944,
"id": "af76b3d2e2ea4b37a1ab191f37ccb068",
"message": "Detection Event",
"priority": "WARNING",
"source_code": {
"funcName": "_save_sample",
"lineno": 110,
"pathname": "/workspace/src/ambianic/pipeline/store.py"
}
},
{
"args": {
"datetime": "2019-10-28T00:00:54.490916",
Expand Down
274 changes: 274 additions & 0 deletions src/assets/mock-data/timeline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
[
{
"args": {
"datetime": "2020-05-10T19:05:45.577145",
"id": "page2",
"image_file_name": "20200510-190545.577145-image.jpg",
"inference_meta": {
"display": "Object Detection"
},
"inference_result": [
{
"box": {
"xmax": 0.7228575944900513,
"xmin": 0.3868940770626068,
"ymax": 1,
"ymin": 0.12535724414170846
},
"confidence": 0.9921875,
"label": "person"
}
],
"json_file_name": "20200510-190545.577145-inference.json",
"rel_dir": "detections/20200510-190544.936209",
"thumbnail_file_name": "20200510-190545.577145-thumbnail.jpg"
},
"created": 1589137545.6190686,
"id": "page2",
"message": "Detection Event",
"priority": "INFO",
"source_code": {
"funcName": "_save_sample",
"lineno": 117,
"pathname": "/workspace/src/ambianic/pipeline/store.py"
}
},
{
"args": {
"datetime": "2020-05-10T19:05:45.577145",
"id": "page2",
"image_file_name": "20200510-190545.577145-image.jpg",
"inference_meta": {
"display": "Object Detection"
},
"inference_result": [
{
"box": {
"xmax": 0.7228575944900513,
"xmin": 0.3868940770626068,
"ymax": 1,
"ymin": 0.12535724414170846
},
"confidence": 0.9921875,
"label": "person"
}
],
"json_file_name": "20200510-190545.577145-inference.json",
"rel_dir": "detections/20200510-190544.936209",
"thumbnail_file_name": "20200510-190545.577145-thumbnail.jpg"
},
"created": 1589137545.6190686,
"id": "page2",
"message": "Detection Event",
"priority": "INFO",
"source_code": {
"funcName": "_save_sample",
"lineno": 117,
"pathname": "/workspace/src/ambianic/pipeline/store.py"
}
},
{
"args": {
"datetime": "2020-05-10T19:05:45.577145",
"id": "page2",
"image_file_name": "20200510-190545.577145-image.jpg",
"inference_meta": {
"display": "Object Detection"
},
"inference_result": [
{
"box": {
"xmax": 0.7228575944900513,
"xmin": 0.3868940770626068,
"ymax": 1,
"ymin": 0.12535724414170846
},
"confidence": 0.9921875,
"label": "face"
}
],
"json_file_name": "20200510-190545.577145-inference.json",
"rel_dir": "detections/20200510-190544.936209",
"thumbnail_file_name": "20200510-190545.577145-thumbnail.jpg"
},
"created": 1589137545.6190686,
"id": "page2",
"message": "Detection Event",
"priority": "INFO",
"source_code": {
"funcName": "_save_sample",
"lineno": 117,
"pathname": "/workspace/src/ambianic/pipeline/store.py"
}
},
{
"args": {
"datetime": "2020-05-10T19:05:45.577145",
"id": "page1",
"image_file_name": "20200510-190545.577145-image.jpg",
"inference_meta": {
"display": "Object Detection"
},
"inference_result": [
{
"box": {
"xmax": 0.7228575944900513,
"xmin": 0.3868940770626068,
"ymax": 1,
"ymin": 0.12535724414170846
},
"confidence": 0.9921875,
"label": "car"
}
],
"json_file_name": "20200510-190545.577145-inference.json",
"rel_dir": "detections/20200510-190544.936209",
"thumbnail_file_name": "20200510-190545.577145-thumbnail.jpg"
},
"created": 1589137545.6190686,
"id": "page1",
"message": "Detection Event",
"priority": "INFO",
"source_code": {
"funcName": "_save_sample",
"lineno": 117,
"pathname": "/workspace/src/ambianic/pipeline/store.py"
}
},
{
"args": {
"datetime": "2020-05-10T19:05:45.577145",
"id": "page1",
"image_file_name": "20200510-190545.577145-image.jpg",
"inference_meta": {
"display": "Object Detection"
},
"inference_result": [
{
"box": {
"xmax": 0.7228575944900513,
"xmin": 0.3868940770626068,
"ymax": 1,
"ymin": 0.12535724414170846
},
"confidence": 0.9921875,
"label": "cat"
}
],
"json_file_name": "20200510-190545.577145-inference.json",
"rel_dir": "detections/20200510-190544.936209",
"thumbnail_file_name": "20200510-190545.577145-thumbnail.jpg"
},
"created": 1589137545.6190686,
"id": "page1",
"message": "Detection Event",
"priority": "INFO",
"source_code": {
"funcName": "_save_sample",
"lineno": 117,
"pathname": "/workspace/src/ambianic/pipeline/store.py"
}
},
{
"args": {
"datetime": "2020-05-10T19:05:45.577145",
"id": "page1",
"image_file_name": "20200510-190545.577145-image.jpg",
"inference_meta": {
"display": "Object Detection"
},
"inference_result": [
{
"box": {
"xmax": 0.7228575944900513,
"xmin": 0.3868940770626068,
"ymax": 1,
"ymin": 0.12535724414170846
},
"confidence": 0.9921875,
"label": "dog"
}
],
"json_file_name": "20200510-190545.577145-inference.json",
"rel_dir": "detections/20200510-190544.936209",
"thumbnail_file_name": "20200510-190545.577145-thumbnail.jpg"
},
"created": 1589137545.6190686,
"id": "page1",
"message": "Detection Event",
"priority": "INFO",
"source_code": {
"funcName": "_save_sample",
"lineno": 117,
"pathname": "/workspace/src/ambianic/pipeline/store.py"
}
},
{
"args": {
"datetime": "2020-05-10T19:05:45.577145",
"id": "page1",
"image_file_name": "20200510-190545.577145-image.jpg",
"inference_meta": {
"display": "Object Detection"
},
"inference_result": [
{
"box": {
"xmax": 0.7228575944900513,
"xmin": 0.3868940770626068,
"ymax": 1,
"ymin": 0.12535724414170846
},
"confidence": 0.9921875,
"label": "person"
}
],
"json_file_name": "20200510-190545.577145-inference.json",
"rel_dir": "detections/20200510-190544.936209",
"thumbnail_file_name": "20200510-190545.577145-thumbnail.jpg"
},
"created": 1589137545.6190686,
"id": "page1",
"message": "Detection Event",
"priority": "INFO",
"source_code": {
"funcName": "_save_sample",
"lineno": 117,
"pathname": "/workspace/src/ambianic/pipeline/store.py"
}
},
{
"args": {
"datetime": "2020-05-10T19:05:45.577145",
"id": "page1",
"image_file_name": "20200510-190545.577145-image.jpg",
"inference_meta": {
"display": "Object Detection"
},
"inference_result": [
{
"box": {
"xmax": 0.7228575944900513,
"xmin": 0.3868940770626068,
"ymax": 1,
"ymin": 0.12535724414170846
},
"confidence": 0.9921875,
"label": "person"
}
],
"json_file_name": "20200510-190545.577145-inference.json",
"rel_dir": "detections/20200510-190544.936209",
"thumbnail_file_name": "20200510-190545.577145-thumbnail.jpg"
},
"created": 1589137545.6190686,
"id": "page1",
"message": "Detection Event",
"priority": "INFO",
"source_code": {
"funcName": "_save_sample",
"lineno": 117,
"pathname": "/workspace/src/ambianic/pipeline/store.py"
}
}
]
Loading

0 comments on commit 934231c

Please sign in to comment.