Skip to content

Commit 5e5df48

Browse files
authored
Camera disconnected + stream normalization improvements (#1701)
1 parent 009ec9e commit 5e5df48

File tree

7 files changed

+179
-130
lines changed

7 files changed

+179
-130
lines changed
Lines changed: 57 additions & 0 deletions
Loading

photon-client/src/components/app/photon-camera-stream.vue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
<script setup lang="ts">
22
import { computed, inject, ref, onBeforeUnmount } from "vue";
33
import { useStateStore } from "@/stores/StateStore";
4-
import loadingImage from "@/assets/images/loading.svg";
4+
import loadingImage from "@/assets/images/loading-transparent.svg";
55
import type { StyleValue } from "vue/types/jsx";
66
import PvIcon from "@/components/common/pv-icon.vue";
77
import type { UiCameraConfiguration } from "@/types/SettingTypes";
88
99
const props = defineProps<{
1010
streamType: "Raw" | "Processed";
1111
id: string;
12-
outerId?: string;
1312
cameraSettings: UiCameraConfiguration;
1413
}>();
1514
@@ -91,7 +90,7 @@ onBeforeUnmount(() => {
9190
</script>
9291

9392
<template>
94-
<div :id="outerId" class="stream-container" :style="containerStyle">
93+
<div class="stream-container" :style="containerStyle">
9594
<img :src="loadingImage" class="stream-loading" />
9695
<img
9796
:id="id"
@@ -131,18 +130,25 @@ onBeforeUnmount(() => {
131130
display: flex;
132131
position: relative;
133132
width: 100%;
133+
height: 100%;
134+
max-width: 100%;
135+
max-height: 100%;
136+
justify-content: center;
137+
align-items: center;
134138
}
135139
136140
.stream-loading {
137141
position: absolute;
138-
width: 100%;
139-
height: 100%;
142+
width: 25%;
143+
height: 25%;
144+
object-fit: contain;
140145
}
141146
142147
.stream-video {
143148
position: absolute;
144149
width: 100%;
145150
height: 100%;
151+
object-fit: contain;
146152
}
147153
148154
.stream-overlay {

photon-client/src/components/common/pv-camera-info-card.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ const cameraInfoFor: any = (camera: PVCameraInfo) => {
5757
<td>Path:</td>
5858
<td style="word-break: break-all">{{ cameraInfoFor(camera).path }}</td>
5959
</tr>
60-
<tr v-if="cameraInfoFor(camera).otherPaths !== undefined && cameraInfoFor(camera).otherPaths !== null">
61-
<td>Other Paths:</td>
62-
<td>{{ cameraInfoFor(camera).otherPaths }}</td>
63-
</tr>
6460
<tr v-if="cameraInfoFor(camera).uniquePath !== undefined && cameraInfoFor(camera).uniquePath !== null">
6561
<td>Unique Path:</td>
6662
<td style="word-break: break-all">{{ cameraInfoFor(camera).uniquePath }}</td>
6763
</tr>
64+
<tr v-if="cameraInfoFor(camera).otherPaths !== undefined && cameraInfoFor(camera).otherPaths !== null">
65+
<td>Other Paths:</td>
66+
<td>{{ cameraInfoFor(camera).otherPaths }}</td>
67+
</tr>
6868
</tbody>
6969
</v-simple-table>
7070
</div>

photon-client/src/components/common/pv-camera-match-card.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,6 @@ const cameraInfoFor = (camera: PVCameraInfo): any => {
9595
<td style="word-break: break-all">{{ cameraInfoFor(saved).path }}</td>
9696
<td style="word-break: break-all">{{ cameraInfoFor(current).path }}</td>
9797
</tr>
98-
<tr
99-
v-if="cameraInfoFor(saved).otherPaths !== undefined && cameraInfoFor(saved).otherPaths !== null"
100-
:class="!_.isEqual(cameraInfoFor(saved).otherPaths, cameraInfoFor(current).otherPaths) ? 'mismatch' : ''"
101-
>
102-
<td>Other Paths:</td>
103-
<td>{{ cameraInfoFor(saved).otherPaths }}</td>
104-
<td>{{ cameraInfoFor(current).otherPaths }}</td>
105-
</tr>
10698
<tr
10799
v-if="cameraInfoFor(saved).uniquePath !== undefined && cameraInfoFor(saved).uniquePath !== null"
108100
:class="cameraInfoFor(saved).uniquePath !== cameraInfoFor(current).uniquePath ? 'mismatch' : ''"
@@ -111,6 +103,14 @@ const cameraInfoFor = (camera: PVCameraInfo): any => {
111103
<td style="word-break: break-all">{{ cameraInfoFor(saved).uniquePath }}</td>
112104
<td style="word-break: break-all">{{ cameraInfoFor(current).uniquePath }}</td>
113105
</tr>
106+
<tr
107+
v-if="cameraInfoFor(saved).otherPaths !== undefined && cameraInfoFor(saved).otherPaths !== null"
108+
:class="!_.isEqual(cameraInfoFor(saved).otherPaths, cameraInfoFor(current).otherPaths) ? 'mismatch' : ''"
109+
>
110+
<td>Other Paths:</td>
111+
<td>{{ cameraInfoFor(saved).otherPaths }}</td>
112+
<td>{{ cameraInfoFor(current).otherPaths }}</td>
113+
</tr>
114114
</tbody>
115115
</v-simple-table>
116116
</div>

photon-client/src/components/common/pv-input.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const handleKeydown = ({ key }) => {
6464
:error-messages="errorMessage"
6565
:rules="rules"
6666
hide-details="auto"
67+
class="light-error"
6768
@keydown="handleKeydown"
6869
/>
6970
</v-col>
@@ -74,3 +75,9 @@ const handleKeydown = ({ key }) => {
7475
margin-top: 0px;
7576
}
7677
</style>
78+
<style>
79+
.light-error .error--text {
80+
color: red !important;
81+
caret-color: red !important;
82+
}
83+
</style>

photon-client/src/components/settings/ObjectDetectionCard.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const supportedModels = computed(() => {
7070
<div class="pa-6 pt-0">
7171
<v-row>
7272
<v-col cols="12 ">
73-
<v-btn color="secondary" @click="() => (showImportDialog = true)" class="justify-center">
73+
<v-btn color="secondary" class="justify-center" @click="() => (showImportDialog = true)">
7474
<v-icon left class="open-icon"> mdi-import </v-icon>
7575
<span class="open-label">Import New Model</span>
7676
</v-btn>
@@ -94,10 +94,10 @@ const supportedModels = computed(() => {
9494
named <code>note-640-640-yolov5s-labels.txt</code>. Note that ONLY 640x640 YOLOv5 & YOLOv8 models
9595
trained and converted to `.rknn` format for RK3588 CPUs are currently supported!
9696
<v-row class="mt-6 ml-4 mr-8">
97-
<v-file-input label="RKNN File" v-model="importRKNNFile" accept=".rknn" />
97+
<v-file-input v-model="importRKNNFile" label="RKNN File" accept=".rknn" />
9898
</v-row>
9999
<v-row class="mt-6 ml-4 mr-8">
100-
<v-file-input label="Labels File" v-model="importLabelsFile" accept=".txt" />
100+
<v-file-input v-model="importLabelsFile" label="Labels File" accept=".txt" />
101101
</v-row>
102102
<v-row
103103
class="mt-12 ml-8 mr-8 mb-1"

0 commit comments

Comments
 (0)