diff options
author | bobzel <zzzman@gmail.com> | 2024-08-26 22:25:58 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-08-26 22:25:58 -0400 |
commit | f0d9731e1c43ee13114d42db8c4e27c94bbbf3c0 (patch) | |
tree | ee5e462ad5e9499f62d51cabf0779ea84077f451 /src | |
parent | b1e88ebc95cb7cdd18b8ba42bb267bcd9372154a (diff) |
made face doc labels editable
Diffstat (limited to 'src')
3 files changed, 14 insertions, 5 deletions
diff --git a/src/client/views/collections/collectionFreeForm/FaceCollectionBox.scss b/src/client/views/collections/collectionFreeForm/FaceCollectionBox.scss index a72efc948..0a001d84c 100644 --- a/src/client/views/collections/collectionFreeForm/FaceCollectionBox.scss +++ b/src/client/views/collections/collectionFreeForm/FaceCollectionBox.scss @@ -11,6 +11,12 @@ color: white; font-size: 24px; text-align: center; + .face-document-name { + text-align: center; + background: transparent; + width: 80%; + border: transparent; + } } .face-collection-buttons { diff --git a/src/client/views/collections/collectionFreeForm/FaceCollectionBox.tsx b/src/client/views/collections/collectionFreeForm/FaceCollectionBox.tsx index 662436ddc..7e47292e5 100644 --- a/src/client/views/collections/collectionFreeForm/FaceCollectionBox.tsx +++ b/src/client/views/collections/collectionFreeForm/FaceCollectionBox.tsx @@ -149,7 +149,9 @@ export class UniqueFaceBox extends ViewBoxBaseComponent<FieldViewProps>() { <IconButton tooltip="Delete Face From Collection" onPointerDown={this.deleteUniqueFace} icon={'x'} style={{ width: '4px' }} size={Size.XSMALL} /> </div> <div className="face-document-top" ref={action((r: HTMLDivElement | null) => (this._headerRef = r))}> - <h1 style={{ color: lightOrDark(StrCast(this.Document.backgroundColor)) }}>{FaceRecognitionHandler.UniqueFaceLabel(this.Document)}</h1> + <h1 style={{ color: lightOrDark(StrCast(this.Document.backgroundColor)) }}> + <input className="face-document-name" type="text" onChange={e => FaceRecognitionHandler.SetUniqueFaceLabel(this.Document, e.currentTarget.value)} value={FaceRecognitionHandler.UniqueFaceLabel(this.Document)} /> + </h1> </div> <div className="face-collection-toggle"> <IconButton diff --git a/src/client/views/search/FaceRecognitionHandler.tsx b/src/client/views/search/FaceRecognitionHandler.tsx index 8513ec94d..dee0ab99b 100644 --- a/src/client/views/search/FaceRecognitionHandler.tsx +++ b/src/client/views/search/FaceRecognitionHandler.tsx @@ -24,7 +24,7 @@ import { DocumentManager } from '../../util/DocumentManager'; * unique face Doc's are created for each person identified and are stored in the Dashboard's myUniqueFaces field * * Each unique face Doc represents a unique face and collects all matching face images for that person. It has these fields: - * face_label - a string label for the person that was recognized (TODO: currently it's just a 'face#') + * face - a string label for the person that was recognized (TODO: currently it's just a 'face#') * face_descriptors - a list of all the face descriptors for different images of the person * face_docList - a list of all image Docs that contain a face for the person */ @@ -108,7 +108,9 @@ export class FaceRecognitionHandler { * @param faceDoc unique face Doc * @returns label string */ - public static UniqueFaceLabel = (faceDoc: Doc) => StrCast(faceDoc[DocData].face_label); + public static UniqueFaceLabel = (faceDoc: Doc) => StrCast(faceDoc[DocData].face); + + public static SetUniqueFaceLabel = (faceDoc: Doc, value: string) => (faceDoc[DocData].face = value); /** * Returns all the face descriptors associated with a unique face Doc * @param faceDoc unique face Doc @@ -186,8 +188,7 @@ export class FaceRecognitionHandler { _height: 100, }); const uface = uniqueFaceDoc[DocData]; - uface.face = ''; // just to make prettyprinting look better - uface.face_label = `Face${faceDocNum}`; + uface.face = `Face${faceDocNum}`; uface.face_images = new List<Doc>(); uface.face_descriptors = new List<List<number>>(); Doc.SetContainer(uniqueFaceDoc, Doc.MyFaceCollection); |