diff --git a/asset-manifest.json b/asset-manifest.json index 1e52cf4..498be06 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,15 +1,15 @@ { "files": { "main.css": "./static/css/main.435d5fe5.chunk.css", - "main.js": "./static/js/main.b8504990.chunk.js", - "main.js.map": "./static/js/main.b8504990.chunk.js.map", + "main.js": "./static/js/main.1e2a862b.chunk.js", + "main.js.map": "./static/js/main.1e2a862b.chunk.js.map", "runtime-main.js": "./static/js/runtime-main.2f85583a.js", "runtime-main.js.map": "./static/js/runtime-main.2f85583a.js.map", "static/css/2.5c9bb0f6.chunk.css": "./static/css/2.5c9bb0f6.chunk.css", "static/js/2.063a3519.chunk.js": "./static/js/2.063a3519.chunk.js", "static/js/2.063a3519.chunk.js.map": "./static/js/2.063a3519.chunk.js.map", "index.html": "./index.html", - "precache-manifest.34377d8055c092e57aa1b1ad106407e0.js": "./precache-manifest.34377d8055c092e57aa1b1ad106407e0.js", + "precache-manifest.9c62a393df5ad69a9e49311cc032b54d.js": "./precache-manifest.9c62a393df5ad69a9e49311cc032b54d.js", "service-worker.js": "./service-worker.js", "static/css/2.5c9bb0f6.chunk.css.map": "./static/css/2.5c9bb0f6.chunk.css.map", "static/css/main.435d5fe5.chunk.css.map": "./static/css/main.435d5fe5.chunk.css.map", @@ -20,6 +20,6 @@ "static/css/2.5c9bb0f6.chunk.css", "static/js/2.063a3519.chunk.js", "static/css/main.435d5fe5.chunk.css", - "static/js/main.b8504990.chunk.js" + "static/js/main.1e2a862b.chunk.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index 219c813..9b8096b 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -AVAT - ALPHA
\ No newline at end of file +AVAT - ALPHA
\ No newline at end of file diff --git a/precache-manifest.34377d8055c092e57aa1b1ad106407e0.js b/precache-manifest.9c62a393df5ad69a9e49311cc032b54d.js similarity index 76% rename from precache-manifest.34377d8055c092e57aa1b1ad106407e0.js rename to precache-manifest.9c62a393df5ad69a9e49311cc032b54d.js index 6de581c..dba29c9 100644 --- a/precache-manifest.34377d8055c092e57aa1b1ad106407e0.js +++ b/precache-manifest.9c62a393df5ad69a9e49311cc032b54d.js @@ -1,6 +1,6 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([ { - "revision": "eabff5c6902824a576eed9263468f2d3", + "revision": "65fe8159b1c7de9150a248c718ef088b", "url": "./index.html" }, { @@ -8,7 +8,7 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([ "url": "./static/css/2.5c9bb0f6.chunk.css" }, { - "revision": "6cab35f3dff09e6deb82", + "revision": "358b8bf2d7681652eb3b", "url": "./static/css/main.435d5fe5.chunk.css" }, { @@ -20,8 +20,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([ "url": "./static/js/2.063a3519.chunk.js.LICENSE.txt" }, { - "revision": "6cab35f3dff09e6deb82", - "url": "./static/js/main.b8504990.chunk.js" + "revision": "358b8bf2d7681652eb3b", + "url": "./static/js/main.1e2a862b.chunk.js" }, { "revision": "981fb04b7452c6560ad9", diff --git a/service-worker.js b/service-worker.js index 3bed2d6..66930d9 100644 --- a/service-worker.js +++ b/service-worker.js @@ -14,7 +14,7 @@ importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); importScripts( - "./precache-manifest.34377d8055c092e57aa1b1ad106407e0.js" + "./precache-manifest.9c62a393df5ad69a9e49311cc032b54d.js" ); self.addEventListener('message', (event) => { diff --git a/static/js/main.b8504990.chunk.js b/static/js/main.1e2a862b.chunk.js similarity index 64% rename from static/js/main.b8504990.chunk.js rename to static/js/main.1e2a862b.chunk.js index 99850ed..610763d 100644 --- a/static/js/main.b8504990.chunk.js +++ b/static/js/main.1e2a862b.chunk.js @@ -1,2 +1,2 @@ -(this.webpackJsonpavat=this.webpackJsonpavat||[]).push([[0],{111:function(e){e.exports=JSON.parse('[{"src":"/assets/tensorflow.gif","altText":"Model assisted annotation","description":"Supports integration with pre-trained Tensorflow models to accelerate annotation","slide_time":10000},{"src":"/assets/add_remove.gif","altText":"Quickly add and remove annotations","description":"Add and remove annotations with ease with individual edits or whole frame edits","slide_time":8000},{"src":"/assets/bounding_box.png","altText":"Bounding Box","description":"Rectangle that serves as a point of refrence for training object detection AI models. This annotation can be coupled with behavior data.","slide_time":4000},{"src":"/assets/annotation_count.png","altText":"Keep track of multiple annotations accross frames","description":"Full frame data summary helps keep track of multiple annotations by local and global id.","slide_time":4000},{"src":"/assets/youtube.png","altText":"Video Support","description":"Supports videos from Local Files, Youtube, Vimeo and Dailymotion","slide_time":4000}]')},113:function(e,t,a){e.exports=a(213)},118:function(e,t,a){},119:function(e,t,a){},145:function(e,t){},146:function(e,t){},147:function(e,t){},213:function(e,t,a){"use strict";a.r(t);var n=a(0),i=a.n(n),l=a(14),o=a.n(l);a(118),a(119),a(120),a(38);var r=a(89);const s=a(48).fabric;s.util.createClass(s.Rect,{type:"boundingbox",initialize:function(e){e||(e={}),this.callSuper("initialize",e),this.set("label",e.label||"")},toObject:function(){return s.util.object.extend(this.callSuper("toObject"),{label:this.get("label")})},_render:function(e){this.callSuper("_render",e),e.font="10px Helvetica",e.fillStyle="#333",e.fillText(this.label,-this.width/2,-this.height/2+20),e.uniScaleTransform=!1}});const c=a(48).fabric;class d{constructor(e,t,a,n,i,l,o){this.top=e,this.left=t,this.id=l,this.behavior=o,this.color=i,this.width=a,this.height=n}rectangle(){return new c.Rect({hasRotatingPoint:!1,height:this.height,width:this.width,fill:this.color,opacity:".4",top:this.top,left:this.left})}id_text(){return new c.Text(this.id.toString(),{fontSize:20,top:this.top,left:this.left,uniScaleTransform:!1})}generate_no_behavior(){var e=new c.Group([this.rectangle(),this.id_text()],{borderColor:"#000000",hasBorders:!0,uniScaleTransform:!0});var t=this.id;return e.local_id=t,e.toJSON()}generate_mouse_no_behavior(e){var t,a,n,i;new c.Text(this.id.toString(),{fontSize:20,top:this.top,left:this.left,uniScaleTransform:!1});e.on("mouse:down",(function(l){a=!0;var o=e.getPointer(l.e);n=o.x,i=o.y;o=e.getPointer(l.e);var r=new c.Rect({left:n,top:i,originX:"left",originY:"top",width:o.x-n,height:o.y-i,angle:0,fill:"rgba(255,0,0,0.5)",transparentCorners:!1,uniScaleTransform:!0});t=r,e.add(t)})),e.on("mouse:move",(function(l){if(a){var o=e.getPointer(l.e);n>o.x&&t.set({left:Math.abs(o.x)}),i>o.y&&t.set({top:Math.abs(o.y)}),t.set({width:Math.abs(n-o.x)}),t.set({height:Math.abs(i-o.y)}),e.renderAll()}})),e.on("mouse:up",(function(t){a=!1,e.off("mouse:down"),e.off("mouse:up")}))}}const m=a(48).fabric;a(148);class u{constructor(e,t,a){this.frame_data=e.annotations,this.annotation_data=e.behavior_data,this.width=t,this.height=a,this.metadata=e.vid_metadata}get_frame_data(){return this.scale_annotations()}get_frame_rate(){try{return this.metadata.frame_rate}catch(e){return 1}}get_annotation_data(){return this.annotation_data}find_highest_localid(){for(var e=[],t=0;t[{dataField:"id",text:"ID",headerStyle:()=>({width:"40px",left:0}),editable:!1},{dataField:"global_id",text:"Glo",headerStyle:()=>({width:"70px",left:0})},{dataField:"posture",text:"Posture",editor:{type:h.Type.SELECT,options:g}},{dataField:"behavior",text:"Behavior",editor:{type:h.Type.SELECT,options:p}},{dataField:"confidence",text:"Confidence",editor:{type:h.Type.SELECT,options:f}},{dataField:"remove",text:"Del",editable:!1,headerStyle:()=>({width:"50px",left:0}),headerFormatter:()=>i.a.createElement("div",null,"Del",i.a.createElement(_.a,{className:"btn btn-danger btn-xs",onClick:()=>e(),label:"Del"})),formatter:(t,a)=>i.a.createElement("div",null,i.a.createElement(_.a,{className:"btn btn-danger btn-xs",onClick:()=>e(a.id),label:"Del"}))}];var v=a(76),y=a(54),E=a(218),w=a(45),S=a(25),k=a(13),O=a(219),j=a(10);a(158);function x(){return i.a.createElement("div",null,i.a.createElement("h3",null,"Keybinds:"),"There are preset keybinds setup to make it easier to use the tool without having to click around. If done properly a combination of mouse and keyboard actions speed up the annotation process.",i.a.createElement("br",null),i.a.createElement("br",null),"* ",i.a.createElement("kbd",null,"1")," : Mode Switch: Behavior",i.a.createElement("br",null),"* ",i.a.createElement("kbd",null,"2")," : Mode Switch: Bounding Box",i.a.createElement("br",null),"* ",i.a.createElement("kbd",null,"3")," : Mode Switch: Segmentation (Currently Disabled)",i.a.createElement("br",null),"* ",i.a.createElement("kbd",null,"a")," : Add annotation",i.a.createElement("br",null),"* ",i.a.createElement("kbd",null,"e")," : Skip forward frame(s)",i.a.createElement("br",null),"* ",i.a.createElement("kbd",null,"q")," : Skip backward frame(s)",i.a.createElement("br",null),"* ",i.a.createElement("kbd",null,"w")," : Pause/Play",i.a.createElement("br",null),i.a.createElement("br",null),i.a.createElement("br",null),i.a.createElement("h3",null,"Uploading Video:"),'Ensure that you know the framerate of the video chosen to be annotated. These values should be entered into the settings tab into their "frame rate" fields.',i.a.createElement("br",null),i.a.createElement("br",null),"Click on the right side browse button. All other buttons on the screen shuold be disabled until the video has been uploaded. Currenntly ```.mp4``` format is the best choice and tested for. Other file types such as .avi are supported but might have unintended bugs.",i.a.createElement("br",null),"Please note that videos SHOULD be in 16:9 aspect ratio for best results. Extraneous behavior may occur if resolution is different.",i.a.createElement("br",null),i.a.createElement("br",null),i.a.createElement("h3",null,"Uploading Image:"),"Select all of the image files needed for the various inputs. To select a group of images, they should be in the same folder.",i.a.createElement("br",null),"Please note that images SHOULD be in 16:9 aspect ratio for best results. Extraneous behavior may occur if resolution is different.",i.a.createElement("br",null),i.a.createElement("br",null),i.a.createElement("h3",null,"Annotations"),i.a.createElement("br",null),"There are currently two kinds of annotations.",i.a.createElement("br",null),i.a.createElement("br",null),i.a.createElement("h4",null,"Behavior Annotation:"),"This is for having annotations that do not have any visual attribute attached to it. This annotation is also attached by default when the bounding box or segmentation annotation is created.",i.a.createElement("br",null),i.a.createElement("br",null),i.a.createElement("h4",null,"Bounding Box:"),"This forms a square around the desired object. There should be small squares at the edges of the bounding box which can be used to resize the box. The number on the top left of the box is used to identify the placement of the box in the table to the right.",i.a.createElement("br",null),i.a.createElement("br",null))}var C=a(16);const T=Object(C.b)({name:"frame_data",initialState:{data:[]},reducers:{init(e,t){for(var a=[],n=0;ne({serializableCheck:!1})}}),{init:N,modifyFrame:F}=T.actions;var A=T.reducer;const I=Object(C.b)({name:"annotation_data",initialState:{data:[]},reducers:{init(e,t){console.log(t.payload);for(var a=[],n=0;ne({serializableCheck:!1})}}),{init:B,modifyFrame:P}=I.actions;var R=I.reducer;const z={data:void 0},D=Object(C.b)({name:"column_annot",initialState:z,reducers:{init(e,t){console.log(t.payload.data),e.data=t.payload.data},middleware:e=>e({serializableCheck:!1})}}),{init:M}=D.actions;var V=D.reducer;const L={data:void 0},H=Object(C.b)({name:"current_frame",initialState:L,reducers:{init(e,t){console.log(t.payload.data),e.data=t.payload.data},changeFrame(e,t){e.data=t.payload.data},middleware:e=>e({serializableCheck:!1})}}),{init:U}=H.actions;var J=H.reducer;const Y=Object(C.b)({name:"media_data",initialState:{data:[]},reducers:{init(e,t){for(var a=[],n=0;ne({serializableCheck:!1})}}),{init:K,modifyFrame:X}=Y.actions;var G=Y.reducer;function q(e){Se.dispatch({type:"frame_data/init",payload:e})}function W(e,t){Se.dispatch({type:"frame_data/modifyFrame",payload:{currentFrame:e,data:t}})}function Q(e){return console.log(Se.getState()),JSON.parse(JSON.stringify(Se.getState().frame_data.data[e]))}function Z(e){Se.dispatch({type:"annotation_data/init",payload:e})}function $(e,t){Se.dispatch({type:"annotation_data/modifyFrame",payload:{currentFrame:e,data:t}})}function ee(e){return JSON.parse(JSON.stringify(Se.getState().annotation_data.data[e]))}function te(e){Se.dispatch({type:"column_annot/init",payload:{data:e}})}function ae(){return JSON.parse(JSON.stringify(Se.getState().current_frame)).data}function ne(e){Se.dispatch({type:"current_frame/changeFrame",payload:{data:e}})}function ie(e){Se.dispatch({type:"media_data/init",payload:e})}function le(e,t){Se.dispatch({type:"media_data/addMedia",payload:{stream_num:e,media:t}})}function oe(e){Se.dispatch({type:"metadata/setFrameRate",payload:{frame_rate:e}})}function re(e){Se.dispatch({type:"metadata/setMediaType",payload:{media_type:e}})}function se(e){Se.dispatch({type:"metadata/setTotalFrames",payload:{total_frames:e}})}function ce(e){Se.dispatch({type:"metadata/setSkipValue",payload:{skip_value:e}})}function de(){return JSON.parse(JSON.stringify(Se.getState().metadata))}const me=Object(C.b)({name:"metadata",initialState:{horizontal_res:0,vertical_res:0,frame_rate:1,media_type:"in_video",total_frames:0,skip_value:1},reducers:{init(e,t){e.horizontal_res=t.payload.horizontal_res,e.vertical_res=t.payload.vertical_res,e.frame_rate=t.payload.frame_rate,e.media_type=t.payload.media_type,e.total_frames=t.payload.total_frames},setRes(e,t){e.horizontal_res=t.payload.horizontal_res,e.vertical_res=t.payload.vertical_res},setFrameRate(e,t){if("in_image"!=e.media_type){var a=JSON.parse(JSON.stringify(e)).frame_rate;e.total_frames=e.total_frames/a,e.total_frames=e.total_frames*t.payload.frame_rate,e.frame_rate=t.payload.frame_rate}},setMediaType(e,t){e.media_type=t.payload.media_type},setTotalFrames(e,t){e.total_frames=t.payload.total_frames},setSkipValue(e,t){e.skip_value=t.payload.skip_value},middleware:e=>e({serializableCheck:!1})}}),{init:ue,setRes:he,setFrameRate:pe,setMediaType:ge,setTotalFrames:fe,setSkipValue:_e}=me.actions;var be=me.reducer;const ve=Object(C.b)({name:"play_status",initialState:{play:!1},reducers:{init(e,t){e.play=!1},togglePlay(e,t){e.play=!e.play},middleware:e=>e({serializableCheck:!1})}}),{init:ye,togglePlay:Ee}=ve.actions;var we=ve.reducer,Se=Object(C.a)({reducer:{frame_data:A,annotation_data:R,column_annot:V,current_frame:J,media_data:G,metadata:be,play_status:we},devTools:!1});class ke{constructor(e,t,a,n,i){console.log(t),console.log(a),this.frame_data=e,this.width=t,this.height=a,this.metadata=n,this.image_data=i}get_frame_json(){var e=new Array(this.frame_data.length);console.log(this.metadata),console.log(this.frame_data);for(var t=0;ta(!1),C=()=>{o(!1),d(!0)},T=Object(xe.b)(e=>e.play_status.play),N=e=>{le(parseInt(e.target.id),e.target.files)},F=e=>new Promise((t,a)=>{var n=new FileReader;n.onload=function(e){t(JSON.parse(e.target.result))},n.readAsText(e.target.files[0])});return Object(n.useEffect)(()=>{f(0==T?"Play":"Pause")},[T]),i.a.createElement("div",null,i.a.createElement(j.a,{show:t,onHide:b,size:"lg"},i.a.createElement(j.a.Header,{closeButton:!0},i.a.createElement(j.a.Title,null,"Instructions")),i.a.createElement(j.a.Body,null,i.a.createElement(x,null)),i.a.createElement(j.a.Footer,null,i.a.createElement(_.a,{variant:"secondary",onClick:b},"Close"))),i.a.createElement(j.a,{show:l,onHide:C,size:"lg",backdrop:"static"},i.a.createElement(j.a.Header,null,i.a.createElement(j.a.Title,null,"Upload")),i.a.createElement(j.a.Body,null,i.a.createElement("div",{style:{display:"grid"}},i.a.createElement(S.a,null,"Media Format:",i.a.createElement(S.a.Control,{as:"select",id:"inlineFormCustomSelect",onChange:e=>{var t;"in_video"===(t=e.target.value)?(s("in_video"),re("in_video")):"in_image"===t?(s("in_image"),re("in_image")):alert("Wrong input detected - please report this bug.")},defaultValue:r},i.a.createElement("option",{value:"in_video"},"Video"),i.a.createElement("option",{value:"in_image"},"Image")),i.a.createElement(E.a.Divider,null)),i.a.createElement("div",null,"Stream Num: ",i.a.createElement("input",{type:"number",defaultValue:1,onClick:t=>{e.toggleKeyCheck(!1)},onBlur:t=>{e.toggleKeyCheck(!0)},onChange:e=>{p(e.target.value),ie(e.target.value)}})),i.a.createElement(E.a.Divider,null),(()=>{for(var e=[],t=0;t{N(e)}})),n=i.a.createElement(S.a,{key:t,style:{float:"left",gridColumn:1,gridRow:4}},i.a.createElement(S.a.File,{id:t+"",key:t,label:"Video Upload "+t,accept:".mp4",custom:!0,type:"file",onChange:e=>{N(e)}}));"in_image"===r?e.push(a):"in_video"===r&&e.push(n)}return i.a.createElement("div",null,e.map((e,t)=>e))})(),i.a.createElement(E.a.Divider,null),i.a.createElement(S.a,null,i.a.createElement(S.a.File,{disabled:e.disable_buttons,accept:".json",id:"file",label:"Column Upload",custom:!0,type:"file",onChange:e=>{F(e).then((function(e){void 0!=e.columns&&null!=e?(u(!0),te(e)):alert("Error in processing columns. Please check the file and try again.")}))}})),i.a.createElement(S.a,null,i.a.createElement(S.a.File,{accept:".json",id:"file",label:"Annotation Upload",custom:!0,type:"file",onChange:e.handleOldAnnotation})),i.a.createElement(E.a.Divider,null),"Frame Rate: ",i.a.createElement("input",{type:"number",onClick:t=>{e.toggleKeyCheck(!1)},onBlur:t=>{e.toggleKeyCheck(!0)},onChange:e=>{oe(e.target.value)}}),i.a.createElement(E.a.Divider,null),"Skip Value: ",i.a.createElement("input",{type:"number",defaultValue:"1",onChange:e=>{ce(e.target.value)}}),i.a.createElement(E.a.Divider,null))),i.a.createElement(j.a.Footer,null,i.a.createElement(_.a,{variant:"success",onClick:C},"Upload"))),i.a.createElement(v.a,{sticky:"top",bg:"dark",variant:"dark",className:"bg-5"},i.a.createElement(v.a.Brand,{href:"#home"},"AVAT"),i.a.createElement(y.a,{className:"mr-auto"},i.a.createElement(E.a,{disabled:e.disable_buttons,title:"Export",id:"basic-nav-dropdown"},i.a.createElement(E.a.Item,{onClick:()=>{var t=new ke(Se.getState().frame_data.data,e.video_width,e.video_height,de(),Se.getState().media_data.data[0]).get_frame_json();console.log(t),async function(e,t){const a=JSON.stringify({vid_metadata:t,annotations:e,behavior_data:Se.getState().annotation_data.data});var n=new Blob([a],{type:"application/json"}),i=await URL.createObjectURL(n),l=document.createElement("a");l.href=i,l.download="generated_annotations.json",document.body.appendChild(l),l.click(),document.body.removeChild(l)}(t,de())}},"JSON"),i.a.createElement(E.a.Divider,null)),i.a.createElement(w.a,{onClick:()=>a(!0)},"Instructions"),i.a.createElement(w.a,{onClick:e.handle_link_open},"Report")),i.a.createElement("div",null,i.a.createElement(_.a,{variant:"outline-success",onClick:()=>{o(!0)}},"Upload")," "," ",i.a.createElement(k.a,{as:O.a},i.a.createElement(_.a,{variant:"secondary",disabled:!0},e.display_frame_num)," ",i.a.createElement(k.a.Toggle,{split:!0,variant:"secondary",id:"dropdown-split-basic"}),i.a.createElement(k.a.Menu,null,"Skip Value: ",i.a.createElement("input",{type:"number",defaultValue:"1",onChange:e=>{ce(e.target.value)}})))," ",i.a.createElement(_.a,{variant:"primary",disabled:e.disable_buttons,onClick:e.skip_frame_backward},"Prev")," ","in_video"===r&&i.a.createElement(_.a,{variant:"primary",disabled:e.disable_buttons,onClick:e=>{Se.dispatch({type:"play_status/togglePlay",payload:{}})}},g)," ",i.a.createElement(_.a,{variant:"primary",disabled:e.disable_buttons,onClick:e.skip_frame_forward},"Next")," ",i.a.createElement(k.a,{as:O.a,drop:"left"},i.a.createElement(_.a,{variant:"success",onClick:e.addToCanvas},"Add"),i.a.createElement(k.a.Toggle,{split:!0,variant:"success",id:"dropdown-split-basic"}),i.a.createElement(k.a.Menu,null,i.a.createElement(k.a.Item,{onClick:t=>{e.change_annotation_type("1")}},"Behavior Annotation"),i.a.createElement(k.a.Item,{onClick:t=>{e.change_annotation_type("2")}},"BoundingBox"),i.a.createElement(k.a.Item,{onClick:t=>{e.change_annotation_type("3")}},"Segmentation"))))))}ie(1);const Te=a(48).fabric,Ne=function(e,t,a,n,i,l){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];if("in_image"==t){var r=new Image;return r.onload=function(){o&&l.clear(),void 0!=e&&Te.util.enlivenObjects(e,(function(e){e.forEach((function(e,t){l.add(e)})),l.renderAll()}));var t=new Te.Image(r,{objectCaching:!1,scaleX:n/r.width,scaleY:i/r.height});l.setBackgroundImage(t),l.renderAll()},void(r.src=URL.createObjectURL(a))}o&&l.remove(...l.getObjects()),void 0!=e&&Te.util.enlivenObjects(e,(function(e){e.forEach((function(e,t){l.add(e)})),l.renderAll()})),l.renderAll()};function Fe(e){const[t,a]=Object(n.useState)(null),[l,r]=Object(n.useState)(0),[s,c]=Object(n.useState)(!1),[d,m]=Object(n.useState)(0),u=Object(xe.b)(e=>e.metadata),h=Object(xe.b)(e=>e.frame_data),p=Object(xe.b)(e=>e.media_data),g=Object(xe.b)(e=>e.current_frame),f=g.data,_=Object(xe.b)(e=>e.play_status.play),b=p.data[e.stream_num],v=(e,a)=>{t&&(console.log("SAVING DATA FOR FRAME",e,a),W(e,t.getObjects()))};if(Object(n.useEffect)(()=>{var t,n=new Te.Canvas("c",{uniScaleTransform:!0,uniformScaling:!1,includeDefaultValues:!1});Te.Image.prototype.toObject=(t=Te.Image.prototype.toObject,function(){return Te.util.object.extend(t.call(this),{src:this.toDataURL()})}),n.on("mouse:wheel",(function(e){var t=e.e.deltaY,a=n.getZoom();(a*=.999**t)>20&&(a=20),a<.01&&(a=.01),n.zoomToPoint({x:e.e.offsetX,y:e.e.offsetY},a),e.e.preventDefault(),e.e.stopPropagation()})),n.on("object:moving",(function(e){this.objDrag=!0})),n.on("mouse:down",(function(e){var t=e.e;!0===t.altKey&&(this.isDragging=!0,this.selection=!1,this.lastPosX=t.clientX,this.lastPosY=t.clientY)})),n.on("mouse:move",(function(e){if(this.isDragging){var t=e.e,a=this.viewportTransform;a[4]+=t.clientX-this.lastPosX,a[5]+=t.clientY-this.lastPosY,this.requestRenderAll(),this.lastPosX=t.clientX,this.lastPosY=t.clientY}})),n.on("mouse:up",(function(e){W(f,n.getObjects()),this.objDrag&&(this.objDrag=!1),this.setViewportTransform(this.viewportTransform),this.isDragging=!1,this.selection=!0}));o.a.findDOMNode(this);var i=document.getElementsByTagName("canvas")[2*e.stream_num];n.initialize(i,{height:e.scaling_factor_height,width:e.scaling_factor_width,backgroundColor:null}),a(n)},[]),Object(n.useEffect)(()=>{if(t){v(d,"frame_change"),m(f);var a=document.getElementsByTagName("video")[e.stream_num];1==s&&(a.currentTime=a.duration*((f+1)/u.total_frames)),"in_video"==u.media_type?Ne(Q(f),"in_video",b[0],e.scaling_factor_width,e.scaling_factor_height,t):"in_image"==u.media_type&&Ne(Q(f),"in_image",b[f],e.scaling_factor_width,e.scaling_factor_height,t)}},[g]),Object(n.useEffect)(()=>{if(0!=s){var a=document.getElementsByTagName("video")[e.stream_num];if(_)v(d,"play"),a.play(),Te.util.requestAnimFrame((function e(){t.renderAll(),Te.util.requestAnimFrame(e)}));else{a.pause();let e=Math.ceil(a.currentTime/a.duration*u.total_frames);console.log("FRAME NUMBER",e),ne(e)}}},[_]),Object(n.useEffect)(()=>{t&&Ne(Q(f),u.media_type,b[f],e.scaling_factor_width,e.scaling_factor_height,t)},[h]),null!=t&&void 0!=b&&!1===s&&!1===_&&b.length>0)if("in_video"==u.media_type){var y=document.getElementsByTagName("video")[e.stream_num],E=document.createElement("source");E.src=URL.createObjectURL(b[0]),E.type="video/mp4",y.appendChild(E),y.onloadedmetadata=function(){Z(parseInt(y.duration)),q(parseInt(y.duration)),se(parseInt(y.duration)),y.currentTime=0},y.oncanplaythrough=function(){if(!1===s){var a=new Te.Image(y,{objectCaching:!1,scaleX:e.scaling_factor_width/y.videoWidth,scaleY:e.scaling_factor_height/y.videoHeight});y.width=y.videoWidth,y.height=y.videoHeight,t.setBackgroundImage(a),t.renderAll()}c(!0)}}else"in_image"==u.media_type&&Ne(Q(f),"in_image",b[f],e.scaling_factor_width,e.scaling_factor_height,t);return i.a.createElement("div",{style:{display:"grid"}},i.a.createElement("div",{style:{gridColumn:1,gridRow:1,position:"relative",width:e.scaling_factor_width,height:e.scaling_factor_height,top:0,left:0,opacity:0}},i.a.createElement("video",null)),i.a.createElement("div",{style:{gridColumn:1,gridRow:1,position:"relative",top:0,left:0}},i.a.createElement("canvas",{id:e.stream_num})))}a(163),a(201),a(202);var Ae=a(109),Ie=a(110),Be=a(72);function Pe(e){let{columns:t,data:a,select_data:n,current_frame:l,change_annot:o}=e;const{getTableProps:r,getTableBodyProps:s,headerGroups:c,rows:d,prepareRow:m}=Object(Be.useTable)({columns:t,data:a});return t?i.a.createElement("table",Object.assign({},r(),{style:{border:"solid 1px blue"}}),i.a.createElement("thead",null,c.map(e=>i.a.createElement("tr",e.getHeaderGroupProps(),e.headers.map(e=>i.a.createElement("th",Object.assign({},e.getHeaderProps(),{style:{background:"#657",color:"white",fontWeight:"bold"}}),e.render("Header")))))),i.a.createElement("tbody",s(),d.map((e,a)=>{m(e);const{id:o,global_id:r,posture:s,behavior:c,confidence:d}=e;return function(e,t,a,n,l){var o=[];console.log(l);for(var r=0;ri.a.createElement("option",{value:e.value},e.value)));o.push(c)}return i.a.createElement("tr",{key:e.id},i.a.createElement("td",null,e.id),i.a.createElement("td",null,i.a.createElement("input",{type:"text",style:{width:"50%"},defaultValue:e.global_id,id:n,"data-type":"global_id","data-curr":l,onChange:Re})),o.map((e,t)=>i.a.createElement("td",{id:t},e)),i.a.createElement("td",null,i.a.createElement("input",{type:"button",style:{backgroundColor:"#f44336"},defaultValue:e.global_id,id:n,"data-type":"global_id","data-curr":l,onClick:ze})))}(e.original,n,t,a,l)}))):i.a.createElement("div",null,"No column upload detected.")}const Re=e=>{var t=ee(e.target.dataset.curr);0!==t.length?(t[e.target.id][e.target.dataset.type]=e.target.value,$(parseInt(e.target.dataset.curr),t)):alert("Row changing value failed - please report this bug.")},ze=e=>{var t=ee(e.target.dataset.curr);if(0!==t.length){var a=t[e.target.id].id;console.log(a),t.splice(e.target.id,1),$(parseInt(e.target.dataset.curr),t);for(var n=Q(e.target.dataset.curr),i=0;i[{Header:"Name",columns:[{Header:"Frame",accessor:"frame_num"},{Header:"Count",accessor:"anno_count"},{Header:"Local ID",accessor:"local_id"},{Header:"Global ID",accessor:"global_ids"}]}],[]);return i.a.createElement("div",null,0!=n.length&&i.a.createElement(Ae.a,{defaultActiveKey:"home",id:"uncontrolled-tab-example"},i.a.createElement(Ie.a,{eventKey:"home",title:"Current"},i.a.createElement(Pe,{columns:a,data:t,select_data:l,current_frame:e.currentFrame,change_annot:e.handleChangeAnnot}))))}var Ve=a(88);a(48).fabric;var Le=1920,He=1080,Ue=window.screen.height;Ue>=1080?(Le=1280,He=720):Ue>=1024?(Le=1152,He=648):Ue>=768&&(Le=1024,He=576);var Je,Ye,Ke,Xe,Ge,qe,We=!1,Qe=!0,Ze="",$e={},et=!1;function tt(){const[e,t]=Object(n.useState)(0),[a,l]=Object(n.useState)("1"),[o,s]=Object(n.useState)(0),[c,m]=Object(n.useState)(null),[h,p]=Object(n.useState)(!1),[g,f]=Object(n.useState)(!0),[_,v]=Object(n.useState)(!0),[y,E]=Object(n.useState)([]),w=Object(xe.b)(e=>e.annotation_data.data),S=Object(xe.b)(e=>e.column_annot.data),k=Object(xe.b)(e=>e.current_frame).data,O=Object(xe.b)(e=>e.media_data.data),j=Object(xe.b)(e=>e.metadata);var x=j.media_type,C=parseInt(j.skip_value);Object(n.useEffect)(()=>{if(1==We){var e=ee(k);E(e)}},[k]),Object(n.useEffect)(()=>{1===w.length&&(Z(j.total_frames),q(j.total_frames))},[j]),Object(n.useEffect)(()=>{if(0!=O[0].length)if("in_image"==j.media_type){se(O[0].length),We=!0,Qe=!1,Z(O[0].length),q(O[0].length);var e=O[0][0],a=new Image;a.onload=function(){$e={horizontal_res:a.width,vertical_res:a.height},URL.revokeObjectURL(a.src)},a.src=e,t(10)}else"in_video"==j.media_type&&(We=!0,Qe=!1,Z(O[0].length),q(O[0].length),t(10));Le=1920,He=1080,Ue>=1080?(Le=1280,He=720):Ue>=1024?(Le=1152,He=648):Ue>=768&&(Le=1024,He=576),He*=1/O.length,Le*=1/O.length},[O]);const T=()=>{var e="#"+((1<<24)*Math.random()|0).toString(16);null==y&&E([]);var t="error";if("2"===a){t="b";var n=new d(50,50,50,50,e,o+"b","None").generate_no_behavior(),i=Q(ae());(i=Object.assign([],i)).push(n),W(k,i)}else"1"===a&&(t="f");var l,r=ee(ae());l=N(o+t),(r=Object.assign([],r)).push(l),$(k,r),s(o+1)};Object(n.useEffect)(()=>{1==We&&E(ee(k))},[w]);const N=e=>{var t=JSON.parse(JSON.stringify(Se.getState().column_annot)),a={};t=t.data.columns.columns;for(var n=0;n{null!=c&&(Se.dispatch({type:"frame_data/initOldAnnotation",payload:c.get_frame_data()}),Se.dispatch({type:"annotation_data/initOldAnnotation",payload:c.get_annotation_data()}),oe(c.get_frame_rate()),E(c.get_annotation_data()[0]),s(c.find_highest_localid()))},[c]),Object(n.useEffect)(()=>{v(!1)},[S]);const F=e=>new Promise((t,a)=>{var n=new FileReader;n.onload=function(e){t(JSON.parse(e.target.result))},n.readAsText(e.target.files[0])}),A=e=>{var t=k+C;if(t>=j.total_frames){if("in_image"===x)return void ne(j.total_frames-1);ne(j.total_frames-1)}else{if("in_image"===x)return void ne(t);ne(t)}},I=e=>{var t=k-C;if(t<0){if("in_image"===x)return void ne(0);ne(0)}else{if("in_image"===x)return void ne(t);ne(t)}},B=e=>{if(!1!==g)if(!0!==et)if("2"===e.key)Ze="Mode Switch: Bounding Box",p(!0),l("2");else if("4"===e.key)Ze="Mode Switch: Key Point",p(!0),l("4");else if("3"===e.key)Ze="Mode Switch: Segmentation",p(!0),l("3");else if("1"===e.key)Ze="Mode Switch: Behavior Annotation",p(!0),l("1");else if("a"===e.key){var t="";"2"===a?t="Bounding Box":"1"===a?t="Behavior Data":"4"===a?t="Keypoint":"3"===a&&(t="Segmentation"),Ze="Added Annotation - "+t,"3"!==a&&p(!0),T()}else"q"===e.key?I():"e"===e.key?A():e.key;else alert("Please finish your current action!")};Object(n.useEffect)(()=>(document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)),[B]);const P=e=>{console.log("Keycheck activated"),f(void 0===e?!g:e)};return i.a.createElement("div",null,i.a.createElement(Ce,{disable_buttons:Qe,video_width:Le,video_height:He,skip_value:C,handleOldAnnotation:e=>{F(e).then((function(e){null!=e?(m(new u(e,Le,He)),function(e,t){Se.dispatch({type:"metadata/setRes",payload:{horizontal_res:e,vertical_res:t}})}(e.vid_metadata.horizontal_res,e.vid_metadata.vertical_res)):alert("Error in processing Annotation. Please check the file and try again.")}))},currentFrame:k,display_frame_num:"Frame #"+parseInt(k+1)+" / "+parseInt(j.total_frames),skip_frame_forward:A,skip_frame_backward:I,addToCanvas:T,ANNOTATION_VIDEO_NAME:"",change_annotation_type:e=>{l(e)},VIDEO_METADATA:$e,toggleKeyCheck:P,handle_visual_toggle:()=>{t(Math.floor(999999999999*Math.random()))}}),i.a.createElement(r.a,{onClose:()=>p(!1),show:h,delay:500,autohide:!0,style:{position:"absolute",top:"100",left:"100",zIndex:"100"}},i.a.createElement(r.a.Header,null,i.a.createElement("strong",{className:"mr-auto"},Ze))),!0===We&&i.a.createElement("div",{style:{display:"grid"}},(()=>{for(var e=[],t=0;te))})(),i.a.createElement("div",{style:{gridColumn:2,gridRow:1,position:"relative",top:0,left:0}},i.a.createElement(Me,{annotation_data:y,change_annotation_data:e=>{E(e)},currentFrame:k,toggleKeyCheck:P,columns:b}))),!1===We&&i.a.createElement("div",null,'"Video/Image upload not detected. Please upload."'))}Z(1),q(1),Je=0,Se.dispatch({type:"current_frame/init",payload:{data:Je}}),Ye=Le,Ke=He,Xe=1,Ge="in_video",qe=1,Se.dispatch({type:"metadata/init",payload:{horizontal_res:Ye,vertical_res:Ke,frame_rate:Xe,media_type:Ge,total_frames:qe}}),Se.dispatch({type:"play_status/init",payload:{}}),console.log(Ve),te(Ve);var at=a(220),nt=a(221),it=a(111);var lt=function(){const[e,t]=Object(n.useState)(!1),a=()=>t(!1),[l,o]=Object(n.useState)(!1),r=e=>{o(!l)},[s,c]=Object(n.useState)(!1);return l?i.a.createElement(tt,null):i.a.createElement("div",null,i.a.createElement(j.a,{show:e,onHide:a,size:"lg"},i.a.createElement(j.a.Header,{closeButton:!0},i.a.createElement(j.a.Title,null,"Instructions")),i.a.createElement(j.a.Body,null,i.a.createElement(x,null)),i.a.createElement(j.a.Footer,null,i.a.createElement(_.a,{variant:"secondary",onClick:a},"Close"))),i.a.createElement("main",null,i.a.createElement(at.a,{className:"text-center"},i.a.createElement(nt.a,null,i.a.createElement("h1",{className:"jumbotron-heading"},"AVAT"),i.a.createElement("p",{className:"lead text-muted"}," Analysis tool to record data for livestock behavior and computer vision applications. "),i.a.createElement("p",null,i.a.createElement(_.a,{onClick:r,variant:"success",className:"mx-1 my-2"},"Video Upload")))),i.a.createElement(Oe.a,{controls:!1,fade:!0,style:{width:"70%",marginLeft:"auto",marginRight:"auto"}},it.map((e,t)=>i.a.createElement(Oe.a.Item,{key:t,interval:e.slide_time},i.a.createElement(je.a,{className:"mb-5 box-shadow",top:"true",width:"100%"},i.a.createElement(je.a.Img,{width:"60%",variant:"top",src:"."+e.src}),i.a.createElement(je.a.Body,{style:{textAlign:"center"}},i.a.createElement(je.a.Title,null,e.altText),i.a.createElement(je.a.Text,null,e.description))))))))};var ot=function(){return i.a.createElement("div",null,i.a.createElement(lt,null))};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));o.a.render(i.a.createElement(xe.a,{store:Se},i.a.createElement(ot,null)),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(e=>{e.unregister()}).catch(e=>{console.error(e.message)})},88:function(e){e.exports=JSON.parse('{"columns":{"Header":"Annotations","columns":[{"Header":"Local ID","accessor":"id"},{"Header":"Global ID","accessor":"global_id"}]},"select_data":{}}')}},[[113,1,2]]]); -//# sourceMappingURL=main.b8504990.chunk.js.map \ No newline at end of file +(this.webpackJsonpavat=this.webpackJsonpavat||[]).push([[0],{111:function(e){e.exports=JSON.parse('[{"src":"/assets/tensorflow.gif","altText":"Model assisted annotation","description":"Supports integration with pre-trained Tensorflow models to accelerate annotation","slide_time":10000},{"src":"/assets/add_remove.gif","altText":"Quickly add and remove annotations","description":"Add and remove annotations with ease with individual edits or whole frame edits","slide_time":8000},{"src":"/assets/bounding_box.png","altText":"Bounding Box","description":"Rectangle that serves as a point of refrence for training object detection AI models. This annotation can be coupled with behavior data.","slide_time":4000},{"src":"/assets/annotation_count.png","altText":"Keep track of multiple annotations accross frames","description":"Full frame data summary helps keep track of multiple annotations by local and global id.","slide_time":4000},{"src":"/assets/youtube.png","altText":"Video Support","description":"Supports videos from Local Files, Youtube, Vimeo and Dailymotion","slide_time":4000}]')},113:function(e,t,a){e.exports=a(213)},118:function(e,t,a){},119:function(e,t,a){},145:function(e,t){},146:function(e,t){},147:function(e,t){},213:function(e,t,a){"use strict";a.r(t);var n=a(0),i=a.n(n),l=a(14),o=a.n(l);a(118),a(119),a(120),a(38);var r=a(89);const s=a(48).fabric;s.util.createClass(s.Rect,{type:"boundingbox",initialize:function(e){e||(e={}),this.callSuper("initialize",e),this.set("label",e.label||"")},toObject:function(){return s.util.object.extend(this.callSuper("toObject"),{label:this.get("label")})},_render:function(e){this.callSuper("_render",e),e.font="10px Helvetica",e.fillStyle="#333",e.fillText(this.label,-this.width/2,-this.height/2+20),e.uniScaleTransform=!1}});const c=a(48).fabric;class d{constructor(e,t,a,n,i,l,o){this.top=e,this.left=t,this.id=l,this.behavior=o,this.color=i,this.width=a,this.height=n}rectangle(){return new c.Rect({hasRotatingPoint:!1,height:this.height,width:this.width,fill:this.color,opacity:".4",top:this.top,left:this.left})}id_text(){return new c.Text(this.id.toString(),{fontSize:20,top:this.top,left:this.left,uniScaleTransform:!1})}generate_no_behavior(){var e=new c.Group([this.rectangle(),this.id_text()],{borderColor:"#000000",hasBorders:!0,uniScaleTransform:!0});var t=this.id;return e.local_id=t,e.toJSON()}generate_mouse_no_behavior(e){var t,a,n,i;new c.Text(this.id.toString(),{fontSize:20,top:this.top,left:this.left,uniScaleTransform:!1});e.on("mouse:down",(function(l){a=!0;var o=e.getPointer(l.e);n=o.x,i=o.y;o=e.getPointer(l.e);var r=new c.Rect({left:n,top:i,originX:"left",originY:"top",width:o.x-n,height:o.y-i,angle:0,fill:"rgba(255,0,0,0.5)",transparentCorners:!1,uniScaleTransform:!0});t=r,e.add(t)})),e.on("mouse:move",(function(l){if(a){var o=e.getPointer(l.e);n>o.x&&t.set({left:Math.abs(o.x)}),i>o.y&&t.set({top:Math.abs(o.y)}),t.set({width:Math.abs(n-o.x)}),t.set({height:Math.abs(i-o.y)}),e.renderAll()}})),e.on("mouse:up",(function(t){a=!1,e.off("mouse:down"),e.off("mouse:up")}))}}const m=a(48).fabric;a(148);class u{constructor(e,t,a){this.frame_data=e.annotations,this.annotation_data=e.behavior_data,this.width=t,this.height=a,this.metadata=e.vid_metadata}get_frame_data(){return this.scale_annotations()}get_frame_rate(){try{return this.metadata.frame_rate}catch(e){return 1}}get_annotation_data(){return this.annotation_data}find_highest_localid(){for(var e=[],t=0;t[{dataField:"id",text:"ID",headerStyle:()=>({width:"40px",left:0}),editable:!1},{dataField:"global_id",text:"Glo",headerStyle:()=>({width:"70px",left:0})},{dataField:"posture",text:"Posture",editor:{type:h.Type.SELECT,options:g}},{dataField:"behavior",text:"Behavior",editor:{type:h.Type.SELECT,options:p}},{dataField:"confidence",text:"Confidence",editor:{type:h.Type.SELECT,options:f}},{dataField:"remove",text:"Del",editable:!1,headerStyle:()=>({width:"50px",left:0}),headerFormatter:()=>i.a.createElement("div",null,"Del",i.a.createElement(_.a,{className:"btn btn-danger btn-xs",onClick:()=>e(),label:"Del"})),formatter:(t,a)=>i.a.createElement("div",null,i.a.createElement(_.a,{className:"btn btn-danger btn-xs",onClick:()=>e(a.id),label:"Del"}))}];var v=a(76),y=a(54),E=a(218),w=a(45),S=a(25),k=a(13),O=a(219),j=a(10);a(158);function x(){return i.a.createElement("div",null,i.a.createElement("h3",null,"Keybinds:"),"There are preset keybinds setup to make it easier to use the tool without having to click around. If done properly a combination of mouse and keyboard actions speed up the annotation process.",i.a.createElement("br",null),i.a.createElement("br",null),"* ",i.a.createElement("kbd",null,"1")," : Mode Switch: Behavior",i.a.createElement("br",null),"* ",i.a.createElement("kbd",null,"2")," : Mode Switch: Bounding Box",i.a.createElement("br",null),"* ",i.a.createElement("kbd",null,"3")," : Mode Switch: Segmentation (Currently Disabled)",i.a.createElement("br",null),"* ",i.a.createElement("kbd",null,"a")," : Add annotation",i.a.createElement("br",null),"* ",i.a.createElement("kbd",null,"e")," : Skip forward frame(s)",i.a.createElement("br",null),"* ",i.a.createElement("kbd",null,"q")," : Skip backward frame(s)",i.a.createElement("br",null),"* ",i.a.createElement("kbd",null,"w")," : Pause/Play",i.a.createElement("br",null),i.a.createElement("br",null),i.a.createElement("br",null),i.a.createElement("h3",null,"Uploading Video:"),'Ensure that you know the framerate of the video chosen to be annotated. These values should be entered into the settings tab into their "frame rate" fields.',i.a.createElement("br",null),i.a.createElement("br",null),"Click on the right side browse button. All other buttons on the screen shuold be disabled until the video has been uploaded. Currenntly ```.mp4``` format is the best choice and tested for. Other file types such as .avi are supported but might have unintended bugs.",i.a.createElement("br",null),"Please note that videos SHOULD be in 16:9 aspect ratio for best results. Extraneous behavior may occur if resolution is different.",i.a.createElement("br",null),i.a.createElement("br",null),i.a.createElement("h3",null,"Uploading Image:"),"Select all of the image files needed for the various inputs. To select a group of images, they should be in the same folder.",i.a.createElement("br",null),"Please note that images SHOULD be in 16:9 aspect ratio for best results. Extraneous behavior may occur if resolution is different.",i.a.createElement("br",null),i.a.createElement("br",null),i.a.createElement("h3",null,"Annotations"),i.a.createElement("br",null),"There are currently two kinds of annotations.",i.a.createElement("br",null),i.a.createElement("br",null),i.a.createElement("h4",null,"Behavior Annotation:"),"This is for having annotations that do not have any visual attribute attached to it. This annotation is also attached by default when the bounding box or segmentation annotation is created.",i.a.createElement("br",null),i.a.createElement("br",null),i.a.createElement("h4",null,"Bounding Box:"),"This forms a square around the desired object. There should be small squares at the edges of the bounding box which can be used to resize the box. The number on the top left of the box is used to identify the placement of the box in the table to the right.",i.a.createElement("br",null),i.a.createElement("br",null))}var C=a(16);const T=Object(C.b)({name:"frame_data",initialState:{data:[]},reducers:{init(e,t){for(var a=[],n=0;ne({serializableCheck:!1})}}),{init:N,modifyFrame:F}=T.actions;var A=T.reducer;const I=Object(C.b)({name:"annotation_data",initialState:{data:[]},reducers:{init(e,t){console.log(t.payload);for(var a=[],n=0;ne({serializableCheck:!1})}}),{init:B,modifyFrame:P}=I.actions;var R=I.reducer;const z={data:void 0},D=Object(C.b)({name:"column_annot",initialState:z,reducers:{init(e,t){console.log(t.payload.data),e.data=t.payload.data},middleware:e=>e({serializableCheck:!1})}}),{init:M}=D.actions;var V=D.reducer;const L={data:void 0},H=Object(C.b)({name:"current_frame",initialState:L,reducers:{init(e,t){console.log(t.payload.data),e.data=t.payload.data},changeFrame(e,t){e.data=t.payload.data},middleware:e=>e({serializableCheck:!1})}}),{init:U}=H.actions;var J=H.reducer;const Y=Object(C.b)({name:"media_data",initialState:{data:[]},reducers:{init(e,t){for(var a=[],n=0;ne({serializableCheck:!1})}}),{init:K,modifyFrame:X}=Y.actions;var G=Y.reducer;function q(e){Se.dispatch({type:"frame_data/init",payload:e})}function W(e,t){Se.dispatch({type:"frame_data/modifyFrame",payload:{currentFrame:e,data:t}})}function Q(e){return console.log(Se.getState()),JSON.parse(JSON.stringify(Se.getState().frame_data.data[e]))}function Z(e){Se.dispatch({type:"annotation_data/init",payload:e})}function $(e,t){Se.dispatch({type:"annotation_data/modifyFrame",payload:{currentFrame:e,data:t}})}function ee(e){return JSON.parse(JSON.stringify(Se.getState().annotation_data.data[e]))}function te(e){Se.dispatch({type:"column_annot/init",payload:{data:e}})}function ae(){return JSON.parse(JSON.stringify(Se.getState().current_frame)).data}function ne(e){Se.dispatch({type:"current_frame/changeFrame",payload:{data:e}})}function ie(e){Se.dispatch({type:"media_data/init",payload:e})}function le(e,t){Se.dispatch({type:"media_data/addMedia",payload:{stream_num:e,media:t}})}function oe(e){Se.dispatch({type:"metadata/setFrameRate",payload:{frame_rate:e}})}function re(e){Se.dispatch({type:"metadata/setMediaType",payload:{media_type:e}})}function se(e){Se.dispatch({type:"metadata/setTotalFrames",payload:{total_frames:e}})}function ce(e){Se.dispatch({type:"metadata/setSkipValue",payload:{skip_value:e}})}function de(){return JSON.parse(JSON.stringify(Se.getState().metadata))}const me=Object(C.b)({name:"metadata",initialState:{horizontal_res:0,vertical_res:0,frame_rate:1,media_type:"in_video",total_frames:0,skip_value:1},reducers:{init(e,t){e.horizontal_res=t.payload.horizontal_res,e.vertical_res=t.payload.vertical_res,e.frame_rate=t.payload.frame_rate,e.media_type=t.payload.media_type,e.total_frames=t.payload.total_frames},setRes(e,t){e.horizontal_res=t.payload.horizontal_res,e.vertical_res=t.payload.vertical_res},setFrameRate(e,t){if("in_image"!=e.media_type){var a=JSON.parse(JSON.stringify(e)).frame_rate;e.total_frames=e.total_frames/a,e.total_frames=e.total_frames*t.payload.frame_rate,e.frame_rate=t.payload.frame_rate}},setMediaType(e,t){e.media_type=t.payload.media_type},setTotalFrames(e,t){e.total_frames=t.payload.total_frames},setSkipValue(e,t){e.skip_value=t.payload.skip_value},middleware:e=>e({serializableCheck:!1})}}),{init:ue,setRes:he,setFrameRate:pe,setMediaType:ge,setTotalFrames:fe,setSkipValue:_e}=me.actions;var be=me.reducer;const ve=Object(C.b)({name:"play_status",initialState:{play:!1},reducers:{init(e,t){e.play=!1},togglePlay(e,t){e.play=!e.play},middleware:e=>e({serializableCheck:!1})}}),{init:ye,togglePlay:Ee}=ve.actions;var we=ve.reducer,Se=Object(C.a)({reducer:{frame_data:A,annotation_data:R,column_annot:V,current_frame:J,media_data:G,metadata:be,play_status:we},devTools:!1});class ke{constructor(e,t,a,n,i){console.log(t),console.log(a),this.frame_data=e,this.width=t,this.height=a,this.metadata=n,this.image_data=i}get_frame_json(){var e=new Array(this.frame_data.length);console.log(this.metadata),console.log(this.frame_data);for(var t=0;ta(!1),C=()=>{o(!1),d(!0)},T=Object(xe.b)(e=>e.play_status.play),N=e=>{le(parseInt(e.target.id),e.target.files)},F=e=>new Promise((t,a)=>{var n=new FileReader;n.onload=function(e){t(JSON.parse(e.target.result))},n.readAsText(e.target.files[0])});return Object(n.useEffect)(()=>{f(0==T?"Play":"Pause")},[T]),i.a.createElement("div",null,i.a.createElement(j.a,{show:t,onHide:b,size:"lg"},i.a.createElement(j.a.Header,{closeButton:!0},i.a.createElement(j.a.Title,null,"Instructions")),i.a.createElement(j.a.Body,null,i.a.createElement(x,null)),i.a.createElement(j.a.Footer,null,i.a.createElement(_.a,{variant:"secondary",onClick:b},"Close"))),i.a.createElement(j.a,{show:l,onHide:C,size:"lg",backdrop:"static"},i.a.createElement(j.a.Header,null,i.a.createElement(j.a.Title,null,"Upload")),i.a.createElement(j.a.Body,null,i.a.createElement("div",{style:{display:"grid"}},i.a.createElement(S.a,null,"Media Format:",i.a.createElement(S.a.Control,{as:"select",id:"inlineFormCustomSelect",onChange:e=>{var t;"in_video"===(t=e.target.value)?(s("in_video"),re("in_video")):"in_image"===t?(s("in_image"),re("in_image")):alert("Wrong input detected - please report this bug.")},defaultValue:r},i.a.createElement("option",{value:"in_video"},"Video"),i.a.createElement("option",{value:"in_image"},"Image")),i.a.createElement(E.a.Divider,null)),i.a.createElement("div",null,"Stream Num: ",i.a.createElement("input",{type:"number",defaultValue:1,onClick:t=>{e.toggleKeyCheck(!1)},onBlur:t=>{e.toggleKeyCheck(!0)},onChange:e=>{p(e.target.value),ie(e.target.value)}})),i.a.createElement(E.a.Divider,null),(()=>{for(var e=[],t=0;t{N(e)}})),n=i.a.createElement(S.a,{key:t,style:{float:"left",gridColumn:1,gridRow:4}},i.a.createElement(S.a.File,{id:t+"",key:t,label:"Video Upload "+t,accept:".mp4",custom:!0,type:"file",onChange:e=>{N(e)}}));"in_image"===r?e.push(a):"in_video"===r&&e.push(n)}return i.a.createElement("div",null,e.map((e,t)=>e))})(),i.a.createElement(E.a.Divider,null),i.a.createElement(S.a,null,i.a.createElement(S.a.File,{disabled:e.disable_buttons,accept:".json",id:"file",label:"Column Upload",custom:!0,type:"file",onChange:e=>{F(e).then((function(e){void 0!=e.columns&&null!=e?(u(!0),te(e)):alert("Error in processing columns. Please check the file and try again.")}))}})),i.a.createElement(S.a,null,i.a.createElement(S.a.File,{accept:".json",id:"file",label:"Annotation Upload",custom:!0,type:"file",onChange:e.handleOldAnnotation})),i.a.createElement(E.a.Divider,null),"Frame Rate: ",i.a.createElement("input",{type:"number",onClick:t=>{e.toggleKeyCheck(!1)},onBlur:t=>{e.toggleKeyCheck(!0)},onChange:e=>{oe(e.target.value)}}),i.a.createElement(E.a.Divider,null),"Skip Value: ",i.a.createElement("input",{type:"number",defaultValue:"1",onChange:e=>{ce(e.target.value)}}),i.a.createElement(E.a.Divider,null))),i.a.createElement(j.a.Footer,null,i.a.createElement(_.a,{variant:"success",onClick:C},"Upload"))),i.a.createElement(v.a,{sticky:"top",bg:"dark",variant:"dark",className:"bg-5"},i.a.createElement(v.a.Brand,{href:"#home"},"AVAT"),i.a.createElement(y.a,{className:"mr-auto"},i.a.createElement(E.a,{disabled:e.disable_buttons,title:"Export",id:"basic-nav-dropdown"},i.a.createElement(E.a.Item,{onClick:()=>{var t=new ke(Se.getState().frame_data.data,e.video_width,e.video_height,de(),Se.getState().media_data.data[0]).get_frame_json();console.log(t),async function(e,t){const a=JSON.stringify({vid_metadata:t,annotations:e,behavior_data:Se.getState().annotation_data.data});var n=new Blob([a],{type:"application/json"}),i=await URL.createObjectURL(n),l=document.createElement("a");l.href=i,l.download="generated_annotations.json",document.body.appendChild(l),l.click(),document.body.removeChild(l)}(t,de())}},"JSON"),i.a.createElement(E.a.Divider,null)),i.a.createElement(w.a,{onClick:()=>a(!0)},"Instructions"),i.a.createElement(w.a,{onClick:e.handle_link_open},"Report")),i.a.createElement("div",null,i.a.createElement(_.a,{variant:"outline-success",onClick:()=>{o(!0)}},"Upload")," "," ",i.a.createElement(k.a,{as:O.a},i.a.createElement(_.a,{variant:"secondary",disabled:!0},e.display_frame_num)," ",i.a.createElement(k.a.Toggle,{split:!0,variant:"secondary",id:"dropdown-split-basic"}),i.a.createElement(k.a.Menu,null,"Skip Value: ",i.a.createElement("input",{type:"number",defaultValue:"1",onChange:e=>{ce(e.target.value)}})))," ",i.a.createElement(_.a,{variant:"primary",disabled:e.disable_buttons,onClick:e.skip_frame_backward},"Prev")," ","in_video"===r&&i.a.createElement(_.a,{variant:"primary",disabled:e.disable_buttons,onClick:e=>{Se.dispatch({type:"play_status/togglePlay",payload:{}})}},g)," ",i.a.createElement(_.a,{variant:"primary",disabled:e.disable_buttons,onClick:e.skip_frame_forward},"Next")," ",i.a.createElement(k.a,{as:O.a,drop:"left"},i.a.createElement(_.a,{variant:"success",onClick:e.addToCanvas},"Add"),i.a.createElement(k.a.Toggle,{split:!0,variant:"success",id:"dropdown-split-basic"}),i.a.createElement(k.a.Menu,null,i.a.createElement(k.a.Item,{onClick:t=>{e.change_annotation_type("1")}},"Behavior Annotation"),i.a.createElement(k.a.Item,{onClick:t=>{e.change_annotation_type("2")}},"BoundingBox"),i.a.createElement(k.a.Item,{onClick:t=>{e.change_annotation_type("3")}},"Segmentation"))))))}ie(1);const Te=a(48).fabric,Ne=function(e,t,a,n,i,l){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];if("in_image"==t){var r=new Image;return r.onload=function(){o&&l.clear(),void 0!=e&&Te.util.enlivenObjects(e,(function(e){e.forEach((function(e,t){l.add(e)})),l.renderAll()}));var t=new Te.Image(r,{objectCaching:!1,scaleX:n/r.width,scaleY:i/r.height});l.setBackgroundImage(t),l.renderAll()},void(r.src=URL.createObjectURL(a))}o&&l.remove(...l.getObjects()),void 0!=e&&Te.util.enlivenObjects(e,(function(e){e.forEach((function(e,t){l.add(e)})),l.renderAll()})),l.renderAll()};function Fe(e){const[t,a]=Object(n.useState)(null),[l,r]=Object(n.useState)(0),[s,c]=Object(n.useState)(!1),[d,m]=Object(n.useState)(0),u=Object(xe.b)(e=>e.metadata),h=Object(xe.b)(e=>e.frame_data),p=Object(xe.b)(e=>e.media_data),g=Object(xe.b)(e=>e.current_frame),f=g.data,_=Object(xe.b)(e=>e.play_status.play),b=p.data[e.stream_num],v=(e,a)=>{t&&(console.log("SAVING DATA FOR FRAME",e,a),W(e,t.getObjects()))};if(Object(n.useEffect)(()=>{var t,n=new Te.Canvas("c",{uniScaleTransform:!0,uniformScaling:!1,includeDefaultValues:!1});Te.Image.prototype.toObject=(t=Te.Image.prototype.toObject,function(){return Te.util.object.extend(t.call(this),{src:this.toDataURL()})}),n.on("mouse:wheel",(function(e){var t=e.e.deltaY,a=n.getZoom();(a*=.999**t)>20&&(a=20),a<.01&&(a=.01),n.zoomToPoint({x:e.e.offsetX,y:e.e.offsetY},a),e.e.preventDefault(),e.e.stopPropagation()})),n.on("object:modified",(function(e){this.objDrag=!0,W(f,n.getObjects())})),n.on("mouse:down",(function(e){var t=e.e;!0===t.altKey&&(this.isDragging=!0,this.selection=!1,this.lastPosX=t.clientX,this.lastPosY=t.clientY)})),n.on("mouse:move",(function(e){if(this.isDragging){var t=e.e,a=this.viewportTransform;a[4]+=t.clientX-this.lastPosX,a[5]+=t.clientY-this.lastPosY,this.requestRenderAll(),this.lastPosX=t.clientX,this.lastPosY=t.clientY}})),n.on("mouse:up",(function(e){this.objDrag&&(this.objDrag=!1),this.setViewportTransform(this.viewportTransform),this.isDragging=!1,this.selection=!0}));o.a.findDOMNode(this);var i=document.getElementsByTagName("canvas")[2*e.stream_num];n.initialize(i,{height:e.scaling_factor_height,width:e.scaling_factor_width,backgroundColor:null}),a(n)},[]),Object(n.useEffect)(()=>{if(t){v(d,"frame_change"),m(f);var a=document.getElementsByTagName("video")[e.stream_num];1==s&&(a.currentTime=a.duration*((f+1)/u.total_frames)),"in_video"==u.media_type?Ne(Q(f),"in_video",b[0],e.scaling_factor_width,e.scaling_factor_height,t):"in_image"==u.media_type&&Ne(Q(f),"in_image",b[f],e.scaling_factor_width,e.scaling_factor_height,t)}},[g]),Object(n.useEffect)(()=>{if(0!=s){var a=document.getElementsByTagName("video")[e.stream_num];if(_)v(d,"play"),a.play(),Te.util.requestAnimFrame((function e(){t.renderAll(),Te.util.requestAnimFrame(e)}));else{a.pause();let e=Math.ceil(a.currentTime/a.duration*u.total_frames);console.log("FRAME NUMBER",e),ne(e)}}},[_]),Object(n.useEffect)(()=>{t&&Ne(Q(f),u.media_type,b[f],e.scaling_factor_width,e.scaling_factor_height,t)},[h]),null!=t&&void 0!=b&&!1===s&&!1===_&&b.length>0)if("in_video"==u.media_type){var y=document.getElementsByTagName("video")[e.stream_num],E=document.createElement("source");E.src=URL.createObjectURL(b[0]),E.type="video/mp4",y.appendChild(E),y.onloadedmetadata=function(){Z(parseInt(y.duration)),q(parseInt(y.duration)),se(parseInt(y.duration)),y.currentTime=0},y.oncanplaythrough=function(){if(!1===s){var a=new Te.Image(y,{objectCaching:!1,scaleX:e.scaling_factor_width/y.videoWidth,scaleY:e.scaling_factor_height/y.videoHeight});y.width=y.videoWidth,y.height=y.videoHeight,t.setBackgroundImage(a),t.renderAll()}c(!0)}}else"in_image"==u.media_type&&Ne(Q(f),"in_image",b[f],e.scaling_factor_width,e.scaling_factor_height,t);return i.a.createElement("div",{style:{display:"grid"}},i.a.createElement("div",{style:{gridColumn:1,gridRow:1,position:"relative",width:e.scaling_factor_width,height:e.scaling_factor_height,top:0,left:0,opacity:0}},i.a.createElement("video",null)),i.a.createElement("div",{style:{gridColumn:1,gridRow:1,position:"relative",top:0,left:0}},i.a.createElement("canvas",{id:e.stream_num})))}a(163),a(201),a(202);var Ae=a(109),Ie=a(110),Be=a(72);function Pe(e){let{columns:t,data:a,select_data:n,current_frame:l,change_annot:o}=e;const{getTableProps:r,getTableBodyProps:s,headerGroups:c,rows:d,prepareRow:m}=Object(Be.useTable)({columns:t,data:a});return t?i.a.createElement("table",Object.assign({},r(),{style:{border:"solid 1px blue"}}),i.a.createElement("thead",null,c.map(e=>i.a.createElement("tr",e.getHeaderGroupProps(),e.headers.map(e=>i.a.createElement("th",Object.assign({},e.getHeaderProps(),{style:{background:"#657",color:"white",fontWeight:"bold"}}),e.render("Header")))))),i.a.createElement("tbody",s(),d.map((e,a)=>{m(e);const{id:o,global_id:r,posture:s,behavior:c,confidence:d}=e;return function(e,t,a,n,l){var o=[];console.log(l);for(var r=0;ri.a.createElement("option",{value:e.value},e.value)));o.push(c)}return i.a.createElement("tr",{key:e.id},i.a.createElement("td",null,e.id),i.a.createElement("td",null,i.a.createElement("input",{type:"text",style:{width:"50%"},defaultValue:e.global_id,id:n,"data-type":"global_id","data-curr":l,onChange:Re})),o.map((e,t)=>i.a.createElement("td",{id:t},e)),i.a.createElement("td",null,i.a.createElement("input",{type:"button",style:{backgroundColor:"#f44336"},defaultValue:e.global_id,id:n,"data-type":"global_id","data-curr":l,onClick:ze})))}(e.original,n,t,a,l)}))):i.a.createElement("div",null,"No column upload detected.")}const Re=e=>{var t=ee(e.target.dataset.curr);0!==t.length?(t[e.target.id][e.target.dataset.type]=e.target.value,$(parseInt(e.target.dataset.curr),t)):alert("Row changing value failed - please report this bug.")},ze=e=>{var t=ee(e.target.dataset.curr);if(0!==t.length){var a=t[e.target.id].id;console.log(a),t.splice(e.target.id,1),$(parseInt(e.target.dataset.curr),t);for(var n=Q(e.target.dataset.curr),i=0;i[{Header:"Name",columns:[{Header:"Frame",accessor:"frame_num"},{Header:"Count",accessor:"anno_count"},{Header:"Local ID",accessor:"local_id"},{Header:"Global ID",accessor:"global_ids"}]}],[]);return i.a.createElement("div",null,0!=n.length&&i.a.createElement(Ae.a,{defaultActiveKey:"home",id:"uncontrolled-tab-example"},i.a.createElement(Ie.a,{eventKey:"home",title:"Current"},i.a.createElement(Pe,{columns:a,data:t,select_data:l,current_frame:e.currentFrame,change_annot:e.handleChangeAnnot}))))}var Ve=a(88);a(48).fabric;var Le=1920,He=1080,Ue=window.screen.height;Ue>=1080?(Le=1280,He=720):Ue>=1024?(Le=1152,He=648):Ue>=768&&(Le=1024,He=576);var Je,Ye,Ke,Xe,Ge,qe,We=!1,Qe=!0,Ze="",$e={},et=!1;function tt(){const[e,t]=Object(n.useState)(0),[a,l]=Object(n.useState)("1"),[o,s]=Object(n.useState)(0),[c,m]=Object(n.useState)(null),[h,p]=Object(n.useState)(!1),[g,f]=Object(n.useState)(!0),[_,v]=Object(n.useState)(!0),[y,E]=Object(n.useState)([]),w=Object(xe.b)(e=>e.annotation_data.data),S=Object(xe.b)(e=>e.column_annot.data),k=Object(xe.b)(e=>e.current_frame).data,O=Object(xe.b)(e=>e.media_data.data),j=Object(xe.b)(e=>e.metadata);var x=j.media_type,C=parseInt(j.skip_value);Object(n.useEffect)(()=>{if(1==We){var e=ee(k);E(e)}},[k]),Object(n.useEffect)(()=>{1===w.length&&(Z(j.total_frames),q(j.total_frames))},[j]),Object(n.useEffect)(()=>{if(0!=O[0].length)if("in_image"==j.media_type){se(O[0].length),We=!0,Qe=!1,Z(O[0].length),q(O[0].length);var e=O[0][0],a=new Image;a.onload=function(){$e={horizontal_res:a.width,vertical_res:a.height},URL.revokeObjectURL(a.src)},a.src=e,t(10)}else"in_video"==j.media_type&&(We=!0,Qe=!1,Z(O[0].length),q(O[0].length),t(10));Le=1920,He=1080,Ue>=1080?(Le=1280,He=720):Ue>=1024?(Le=1152,He=648):Ue>=768&&(Le=1024,He=576),He*=1/O.length,Le*=1/O.length},[O]);const T=()=>{var e="#"+((1<<24)*Math.random()|0).toString(16);null==y&&E([]);var t="error";if("2"===a){t="b";var n=new d(50,50,50,50,e,o+"b","None").generate_no_behavior(),i=Q(ae());(i=Object.assign([],i)).push(n),W(k,i)}else"1"===a&&(t="f");var l,r=ee(ae());l=N(o+t),(r=Object.assign([],r)).push(l),$(k,r),s(o+1)};Object(n.useEffect)(()=>{1==We&&E(ee(k))},[w]);const N=e=>{var t=JSON.parse(JSON.stringify(Se.getState().column_annot)),a={};t=t.data.columns.columns;for(var n=0;n{null!=c&&(Se.dispatch({type:"frame_data/initOldAnnotation",payload:c.get_frame_data()}),Se.dispatch({type:"annotation_data/initOldAnnotation",payload:c.get_annotation_data()}),oe(c.get_frame_rate()),E(c.get_annotation_data()[0]),s(c.find_highest_localid()))},[c]),Object(n.useEffect)(()=>{v(!1)},[S]);const F=e=>new Promise((t,a)=>{var n=new FileReader;n.onload=function(e){t(JSON.parse(e.target.result))},n.readAsText(e.target.files[0])}),A=e=>{var t=k+C;if(t>=j.total_frames){if("in_image"===x)return void ne(j.total_frames-1);ne(j.total_frames-1)}else{if("in_image"===x)return void ne(t);ne(t)}},I=e=>{var t=k-C;if(t<0){if("in_image"===x)return void ne(0);ne(0)}else{if("in_image"===x)return void ne(t);ne(t)}},B=e=>{if(!1!==g)if(!0!==et)if("2"===e.key)Ze="Mode Switch: Bounding Box",p(!0),l("2");else if("4"===e.key)Ze="Mode Switch: Key Point",p(!0),l("4");else if("3"===e.key)Ze="Mode Switch: Segmentation",p(!0),l("3");else if("1"===e.key)Ze="Mode Switch: Behavior Annotation",p(!0),l("1");else if("a"===e.key){var t="";"2"===a?t="Bounding Box":"1"===a?t="Behavior Data":"4"===a?t="Keypoint":"3"===a&&(t="Segmentation"),Ze="Added Annotation - "+t,"3"!==a&&p(!0),T()}else"q"===e.key?I():"e"===e.key?A():e.key;else alert("Please finish your current action!")};Object(n.useEffect)(()=>(document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)),[B]);const P=e=>{console.log("Keycheck activated"),f(void 0===e?!g:e)};return i.a.createElement("div",null,i.a.createElement(Ce,{disable_buttons:Qe,video_width:Le,video_height:He,skip_value:C,handleOldAnnotation:e=>{F(e).then((function(e){null!=e?(m(new u(e,Le,He)),function(e,t){Se.dispatch({type:"metadata/setRes",payload:{horizontal_res:e,vertical_res:t}})}(e.vid_metadata.horizontal_res,e.vid_metadata.vertical_res)):alert("Error in processing Annotation. Please check the file and try again.")}))},currentFrame:k,display_frame_num:"Frame #"+parseInt(k+1)+" / "+parseInt(j.total_frames),skip_frame_forward:A,skip_frame_backward:I,addToCanvas:T,ANNOTATION_VIDEO_NAME:"",change_annotation_type:e=>{l(e)},VIDEO_METADATA:$e,toggleKeyCheck:P,handle_visual_toggle:()=>{t(Math.floor(999999999999*Math.random()))}}),i.a.createElement(r.a,{onClose:()=>p(!1),show:h,delay:500,autohide:!0,style:{position:"absolute",top:"100",left:"100",zIndex:"100"}},i.a.createElement(r.a.Header,null,i.a.createElement("strong",{className:"mr-auto"},Ze))),!0===We&&i.a.createElement("div",{style:{display:"grid"}},(()=>{for(var e=[],t=0;te))})(),i.a.createElement("div",{style:{gridColumn:2,gridRow:1,position:"relative",top:0,left:0}},i.a.createElement(Me,{annotation_data:y,change_annotation_data:e=>{E(e)},currentFrame:k,toggleKeyCheck:P,columns:b}))),!1===We&&i.a.createElement("div",null,'"Video/Image upload not detected. Please upload."'))}Z(1),q(1),Je=0,Se.dispatch({type:"current_frame/init",payload:{data:Je}}),Ye=Le,Ke=He,Xe=1,Ge="in_video",qe=1,Se.dispatch({type:"metadata/init",payload:{horizontal_res:Ye,vertical_res:Ke,frame_rate:Xe,media_type:Ge,total_frames:qe}}),Se.dispatch({type:"play_status/init",payload:{}}),console.log(Ve),te(Ve);var at=a(220),nt=a(221),it=a(111);var lt=function(){const[e,t]=Object(n.useState)(!1),a=()=>t(!1),[l,o]=Object(n.useState)(!1),r=e=>{o(!l)},[s,c]=Object(n.useState)(!1);return l?i.a.createElement(tt,null):i.a.createElement("div",null,i.a.createElement(j.a,{show:e,onHide:a,size:"lg"},i.a.createElement(j.a.Header,{closeButton:!0},i.a.createElement(j.a.Title,null,"Instructions")),i.a.createElement(j.a.Body,null,i.a.createElement(x,null)),i.a.createElement(j.a.Footer,null,i.a.createElement(_.a,{variant:"secondary",onClick:a},"Close"))),i.a.createElement("main",null,i.a.createElement(at.a,{className:"text-center"},i.a.createElement(nt.a,null,i.a.createElement("h1",{className:"jumbotron-heading"},"AVAT"),i.a.createElement("p",{className:"lead text-muted"}," Analysis tool to record data for livestock behavior and computer vision applications. "),i.a.createElement("p",null,i.a.createElement(_.a,{onClick:r,variant:"success",className:"mx-1 my-2"},"Video Upload")))),i.a.createElement(Oe.a,{controls:!1,fade:!0,style:{width:"70%",marginLeft:"auto",marginRight:"auto"}},it.map((e,t)=>i.a.createElement(Oe.a.Item,{key:t,interval:e.slide_time},i.a.createElement(je.a,{className:"mb-5 box-shadow",top:"true",width:"100%"},i.a.createElement(je.a.Img,{width:"60%",variant:"top",src:"."+e.src}),i.a.createElement(je.a.Body,{style:{textAlign:"center"}},i.a.createElement(je.a.Title,null,e.altText),i.a.createElement(je.a.Text,null,e.description))))))))};var ot=function(){return i.a.createElement("div",null,i.a.createElement(lt,null))};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));o.a.render(i.a.createElement(xe.a,{store:Se},i.a.createElement(ot,null)),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(e=>{e.unregister()}).catch(e=>{console.error(e.message)})},88:function(e){e.exports=JSON.parse('{"columns":{"Header":"Annotations","columns":[{"Header":"Local ID","accessor":"id"},{"Header":"Global ID","accessor":"global_id"}]},"select_data":{}}')}},[[113,1,2]]]); +//# sourceMappingURL=main.1e2a862b.chunk.js.map \ No newline at end of file diff --git a/static/js/main.b8504990.chunk.js.map b/static/js/main.1e2a862b.chunk.js.map similarity index 70% rename from static/js/main.b8504990.chunk.js.map rename to static/js/main.1e2a862b.chunk.js.map index dac6958..bbf6b9f 100644 --- a/static/js/main.b8504990.chunk.js.map +++ b/static/js/main.1e2a862b.chunk.js.map @@ -1 +1 @@ -{"version":3,"sources":["fabric_types/fabric_boundingbox.js","annotations/bounding_box.js","processing/annotation-processing.js","static_data/behaviors.js","static_data/posture.js","static_data/confidence.js","static_data/columns.js","ui_elements/Components/instructions.js","reducer/frame_data.js","reducer/annotation_data.js","reducer/column_annot.js","reducer/current_frame.js","reducer/media_data.js","processing/actions.js","reducer/metadata.js","reducer/play_status.js","store.js","processing/exporting_annotation.js","ui_elements/Components/nav_bar.js","static_data/const.js","processing/download.js","ui_elements/Components/fabric_canvas.js","ui_elements/Components/annot_table.js","ui_elements/Components/change_table.js","ui_elements/Pages/main_upload.js","static_data/constants.js","ui_elements/Pages/selection_screen.js","App.js","serviceWorker.js","index.js"],"names":["fabric","require","util","createClass","Rect","type","initialize","options","this","callSuper","set","label","toObject","object","extend","get","_render","ctx","font","fillStyle","fillText","width","height","uniScaleTransform","BoundingBox","constructor","top","left","color","id","behavior","rectangle","hasRotatingPoint","fill","opacity","id_text","Text","toString","fontSize","generate_no_behavior","group","Group","borderColor","hasBorders","temp","local_id","toJSON","generate_mouse_no_behavior","canvas","isDown","origX","origY","on","o","pointer","getPointer","e","x","y","rect_temp","originX","originY","angle","transparentCorners","add","Math","abs","renderAll","off","ExtractingAnnotation","annotation_json","frame_data","annotation_data","metadata","get_frame_data","scale_annotations","get_frame_rate","error","get_annotation_data","find_highest_localid","localid","i","length","j","push","parseInt","replace","max","new_annotations","temp_data","curr_frame","random","new_bbox","points","curr_points","k","x_scaled","y_scaled","po","Polygon","strokeWidth","stroke","scaleX","scaleY","objectCaching","cornerColor","display_text","centerX","grouppo","perPixelTargetFind","lockMovementY","lockMovementX","selectable","behaviors","value","posture","confidence","columns","remove_table_index","dataField","text","headerStyle","editable","editor","Type","SELECT","headerFormatter","React","createElement","Button","className","onClick","formatter","cellContent","row","Instructions","frameDataSlice","createSlice","name","initialState","data","reducers","init","state","payload","initOldAnnotation","modifyFrame","currentFrame","middleware","getDefaultMiddleware","serializableCheck","actions","annotationDataSlice","console","log","undefined","columnDataSlice","currFrameDataSlice","changeFrame","mediaDataSlice","addMedia","media","stream_num","initFrameData","frame_count","store","dispatch","updateFrameData","frame_number","getFrameData","getState","JSON","parse","stringify","initAnnotationData","updateAnnotationData","getAnnotationData","initColumnData","column_dat","getCurrentFrame","current_frame","setCurrentFrame","frame_num","initMedia","num_streams","setMedia","setFrameRate","frame_rate","setMediaType","media_type","setTotalFrames","total_frames","setSkipValue","skip_val","skip_value","getMetaData","metadataSlice","horizontal_res","vertical_res","setRes","curr_framerate","playStatusSlice","play","togglePlay","configureStore","reducer","column_annot","media_data","play_status","devTools","process","ExportingAnnotation","VIDEO_METADATA","image_data","get_frame_json","standard_annot","Array","curr","frame_objects","_objects","raw_points","alert","get_frame_json_fullCanvas","get_frame_coco","CustomNavBar","props","show","setShow","useState","uploadShow","setUploadShow","videoFormat","setVideoFormat","setProcess","columnLoad","setColumnLoad","numStrems","setNumStreams","playText","setPlayText","handleClose","handleUploadClose","play_redux","useSelector","handleMediaUpload","event","target","files","downloadColumn","file","Promise","resolve","reject","reader","FileReader","onload","result","readAsText","useEffect","Modal","onHide","size","Header","closeButton","Title","Body","Footer","variant","backdrop","style","display","Form","Control","as","onChange","defaultValue","NavDropdown","Divider","toggleKeyCheck","onBlur","generateUploadButtons","uploadButtons","button_image","key","float","gridColumn","gridRow","File","multiple","accept","custom","button_video","map","but","_","disabled","disable_buttons","then","handleOldAnnotation","Navbar","sticky","bg","Brand","href","Nav","title","Item","handleDownloadJSON","converted_annot","video_width","video_height","async","json","blob","Blob","URL","createObjectURL","link","document","download","fileName","body","appendChild","click","removeChild","downloadFileJSON","NavLink","handleShow","handle_link_open","handleUploadShow","Dropdown","ButtonGroup","display_frame_num","Toggle","split","Menu","skip_frame_backward","skip_frame_forward","drop","addToCanvas","change_annotation_type","canvasBackgroundUpdate","currFrameData","inputType","image_url","scaling_factor_width","scaling_factor_height","fabricCanvas","remove_obj","arguments","img","Image","clear","enlivenObjects","enlivenedObjects","forEach","obj","index","f_img","setBackgroundImage","src","remove","getObjects","FabricRender","setFabricCanvas","currindex","setCurrindex","upload","setUpload","frameToUpdate","setFrameToUpdate","metadata_redux","frame_redux","image_data_store","currFrame","currframe_redux","save_data","reason","temp_fabricCanvas","Canvas","uniformScaling","includeDefaultValues","prototype","call","toDataURL","opt","delta","deltaY","zoom","getZoom","zoomToPoint","offsetX","offsetY","preventDefault","stopPropagation","objDrag","evt","altKey","isDragging","selection","lastPosX","clientX","lastPosY","clientY","vpt","viewportTransform","requestRenderAll","setViewportTransform","ReactDOM","findDOMNode","canvas_elem","getElementsByTagName","backgroundColor","video","currentTime","duration","requestAnimFrame","renderLoop","pause","ceil","source","onloadedmetadata","oncanplaythrough","new_vid","videoWidth","videoHeight","position","AnnotTable","_ref","select_data","change_annot","getTableProps","getTableBodyProps","headerGroups","rows","prepareRow","useTable","Object","assign","border","headerGroup","getHeaderGroupProps","headers","column","getHeaderProps","background","fontWeight","render","global_id","elem","curr_idx","row_vals","curr_elem","check_keys","data-type","data-curr","change_row","beh","delete_row","genSelection","original","curr_data","dataset","annot_delte","splice","curr_img_data","objects","obj_keys","keys","AnnotationTable","col","useMemo","accessor","Tabs","defaultActiveKey","Tab","eventKey","handleChangeAnnot","current_screen_height","window","screen","toast_text","segmentation_flag","MainUpload","visualToggle","setVisualToggle","annotationType","setAnnotationType","boxCount","setBoxCount","oldAnnotation","setOldAnnotation","save","changeSave","keyCheck","changeKeyCheck","isLoading","setIsLoading","currAnnotationData","setCurrAnnotationData","annot_redux","column_redux","imagedata_redux","annot","url","revokeObjectURL","annotation_type_txt","frame_dat","generated_annotation","saved_annot","create_annotation","new_data","downloadOldAnnotation","frameVal","onKeyPress","annotext","addEventListener","removeEventListener","toggle_val","vid_metadata","ANNOTATION_VIDEO_NAME","handle_visual_toggle","floor","Toast","onClose","delay","autohide","zIndex","genFabricCanvas","fcanvas","canv","can","change_annotation_data","val","default_column","SelectionScreen","handleUpload","multiview","setMultiview","Jumbotron","Container","Carousel","controls","fade","selection_items","item","interval","slide_time","Card","Img","altText","description","App","Boolean","location","hostname","match","Provider","getElementById","navigator","serviceWorker","ready","registration","unregister","catch","message"],"mappings":"y0CAAA,MAAMA,EAASC,EAAQ,IAAUD,OAEfA,EAAOE,KAAKC,YAAYH,EAAOI,KAAM,CACnDC,KAAM,cACNC,WAAY,SAASC,GACjBA,IAAYA,EAAU,IAEtBC,KAAKC,UAAU,aAAcF,GAC7BC,KAAKE,IAAI,QAASH,EAAQI,OAAS,KAGvCC,SAAU,WACN,OAAOZ,EAAOE,KAAKW,OAAOC,OAAON,KAAKC,UAAU,YAAa,CACzDE,MAAOH,KAAKO,IAAI,YAIxBC,QAAS,SAASC,GACdT,KAAKC,UAAU,UAAWQ,GAE1BA,EAAIC,KAAO,iBACXD,EAAIE,UAAY,OAGhBF,EAAIG,SAASZ,KAAKG,OAASH,KAAKa,M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EAAaC,eAEdC,MAAMve,IACL4E,QAAQ5E,MAAMA,EAAMwe,Y","file":"static/js/main.b8504990.chunk.js","sourcesContent":["const fabric = require(\"fabric\").fabric;\n\nvar boundingbox = fabric.util.createClass(fabric.Rect, {\n type: 'boundingbox',\n initialize: function(options) {\n options || (options = { });\n\n this.callSuper('initialize', options);\n this.set('label', options.label || '');\n },\n\n toObject: function() {\n return fabric.util.object.extend(this.callSuper('toObject'), {\n label: this.get('label')\n });\n },\n\n _render: function(ctx) {\n this.callSuper('_render', ctx);\n\n ctx.font = '10px Helvetica';\n ctx.fillStyle = '#333';\n /* scaleX = this.width / (this.width * this.scaleX),\n scaleY = this.height / (this.height * this.scaleY); */\n ctx.fillText(this.label, (-this.width/2), (-this.height/2 + 20));\n ctx.uniScaleTransform = false;\n }\n});\n \nexport {boundingbox};","import { boundingbox } from '../fabric_types/fabric_boundingbox'\nconst fabric = require(\"fabric\").fabric;\n\nclass BoundingBox {\n constructor(top, left, width, height, color, id, behavior) {\n this.top = top;\n this.left = left;\n this.id = id;\n this.behavior = behavior;\n this.color = color;\n this.width = width;\n this.height = height;\n }\n\n rectangle(){\n return new fabric.Rect({\n hasRotatingPoint: false,\n height: this.height,\n width: this.width,\n fill: this.color,\n opacity: '.4',\n top: this.top,\n left: this.left,\n });\n } \n\n //TODO Add text scaling\n id_text(){\n return new fabric.Text(this.id.toString(), {\n fontSize: 20,\n top: this.top,\n left: this.left,\n uniScaleTransform: false,\n });\n }\n\n generate_no_behavior(){\n var group = new fabric.Group([this.rectangle(), this.id_text()],{\n borderColor: '#000000',\n hasBorders: true,\n uniScaleTransform: true\n });\n /* var box = new boundingbox({\n hasRotatingPoint: false,\n height: this.height,\n width: this.width,\n fill: this.color,\n opacity: '.4',\n top: this.top,\n left: this.left,\n label: this.id.toString()\n }) */\n\n function onChange(obj) {\n var text_box = obj.target.item(1),\n group = obj.target,\n scaleX = group.width / (group.width * group.scaleX),\n scaleY = group.height / (group.height * group.scaleY);\n text_box.set('scaleX', scaleX);\n text_box.set('scaleY', scaleY);\n }\n /* canvas.on({\n 'object:scaling': onChange\n }) */\n\n var temp = this.id \n group.local_id = temp\n //canvas.add(group)\n //console.log(group.toJSON())\n return group.toJSON()\n }\n\n generate_mouse_no_behavior(canvas){\n var group, isDown, origX, origY;\n\n var temp_id = new fabric.Text(this.id.toString(), {\n fontSize: 20,\n top: this.top,\n left: this.left,\n uniScaleTransform: false,\n });\n\n canvas.on('mouse:down', function(o){\n isDown = true;\n var pointer = canvas.getPointer(o.e);\n origX = pointer.x;\n origY = pointer.y;\n var pointer = canvas.getPointer(o.e);\n var rect_temp = new fabric.Rect({\n left: origX,\n top: origY,\n originX: 'left',\n originY: 'top',\n width: pointer.x-origX,\n height: pointer.y-origY,\n angle: 0,\n fill: 'rgba(255,0,0,0.5)',\n transparentCorners: false,\n uniScaleTransform: true\n });\n group = rect_temp\n\n\n canvas.add(group)\n });\n \n canvas.on('mouse:move', function(o){\n if (!isDown) return;\n var pointer = canvas.getPointer(o.e);\n \n if(origX>pointer.x){\n group.set({ left: Math.abs(pointer.x) });\n }\n if(origY>pointer.y){\n group.set({ top: Math.abs(pointer.y) });\n }\n \n group.set({ width: Math.abs(origX - pointer.x) });\n group.set({ height: Math.abs(origY - pointer.y) });\n \n \n canvas.renderAll();\n });\n \n canvas.on('mouse:up', function(o){\n isDown = false;\n canvas.off('mouse:down')\n canvas.off('mouse:up')\n });\n }\n\n}\n\nexport {BoundingBox}","import {BoundingBox} from '../annotations/bounding_box'\nconst fabric = require(\"fabric\").fabric;\nconst $ = require(\"jquery\")\n\nexport default class ExtractingAnnotation{\n constructor(annotation_json, width, height){\n this.frame_data = annotation_json['annotations']\n this.annotation_data = annotation_json['behavior_data']\n this.width = width\n this.height = height\n this.metadata = annotation_json['vid_metadata']\n }\n\n get_frame_data(){\n return this.scale_annotations()\n }\n\n get_frame_rate(){\n try{\n return this.metadata['frame_rate']\n }catch (error){\n return 1\n }\n }\n \n get_annotation_data(){\n return this.annotation_data;\n }\n\n find_highest_localid(){\n var localid = []\n for(var i = 0; i < this.annotation_data.length; i++){\n for(var j = 0; j < this.annotation_data[i].length; j++){\n localid.push(parseInt(this.annotation_data[i][j]['id'].replace(/\\D/g, \"\")))\n }\n }\n return Math.max(...localid)+1\n }\n\n scale_annotations(){\n var new_annotations = []\n for(var i = 0; i < this.frame_data.length; i++){\n var temp_data = []\n var curr_frame = this.frame_data[i]\n if(curr_frame == null){\n new_annotations.push([])\n continue;\n }\n for(var j = 0; j < curr_frame.length; j++){\n if(curr_frame[j]['type'] === \"bounding_box\"){\n var x = (parseInt(curr_frame[j]['x']) / parseInt(this.metadata['horizontal_res']) * this.width) \n var y = (curr_frame[j]['y'] / this.metadata['vertical_res'] * this.height)\n var width = ((curr_frame[j]['width']) / this.metadata['horizontal_res'] * this.width)\n var height = ((curr_frame[j]['height']) / this.metadata['vertical_res'] * this.height)\n\n var color = \"#\" + ((1<<24)*Math.random() | 0).toString(16)\n var new_bbox = new BoundingBox(y, x, width, height, color, curr_frame[j]['local_id'], \"None\").generate_no_behavior(this)\n //this.add(new_bbox)\n new_bbox.local_id = curr_frame[j]['local_id']\n temp_data.push(new_bbox)\n }else if(curr_frame[j]['type'] === \"segmentation\"){\n var points = []\n var curr_points = curr_frame[j]['points']\n for(var k = 0; k < curr_points.length; k++){\n var x_scaled = (parseInt(curr_points[k]['x']) / parseInt(this.metadata['horizontal_res']) * this.width)\n var y_scaled = (curr_points[k]['y'] / this.metadata['vertical_res'] * this.height)\n points.push({x: x_scaled, y: y_scaled})\n }\n var po = new fabric.Polygon(points, {\n strokeWidth: 1,\n stroke: 'green',\n opacity: .5,\n scaleX: 1,\n scaleY: 1,\n objectCaching: false,\n transparentCorners: false,\n cornerColor: 'blue',\n originX: 'center',\n originY: 'center'\n });\n var display_text = new fabric.Text(curr_frame[j]['local_id'], {\n fontSize: 20,\n centerX: \"center\",\n top: points[0].y,\n left: points[0].x, \n uniScaleTransform: false,\n fill: \"white\",\n })\n var grouppo = new fabric.Group([po, display_text], {perPixelTargetFind: true})\n grouppo.lockMovementY = true;\n grouppo.lockMovementX = true;\n grouppo.selectable = false;\n grouppo.local_id = curr_frame[j]['local_id']\n //this.add(grouppo)\n temp_data.push(grouppo)\n }\n }\n new_annotations.push(temp_data)\n }\n return new_annotations\n }\n}\n\n//This is the parser for the Multi-Camera pig tracking output JSON code. \n/*\nclass MCPT_Processing {\n constructor(annotation_json){\n this.objects = annotation_json['objects']\n }\n\n getObjects_MCPT() {\n return this.objects\n }\n\n getObjectById_MCPT(id) {\n return this.objects[id]\n }\n \n getObjectByIdFrame(id, frame_num){\n return this.objects[id][frame_num]\n }\n\n getAllObjectByFrame_MCPT(frame_num){\n var i;\n var objects_frame = []\n for (i = 0; i < this.objects.length; i++){\n var curr_obj = this.objects[i]\n if(curr_obj['frames'][curr_obj['frames'].length-1]['frameNumber'] < frame_num){\n continue;\n }\n var curr_obj_frames = curr_obj['frames'];\n for (var j = 0; j < curr_obj_frames.length; j++){\n if(curr_obj_frames[j]['frameNumber'] === frame_num){\n objects_frame.push(curr_obj_frames[j]);\n break;\n }\n }\n }\n return objects_frame;\n }\n}*/","const behaviors = [{\n value: 'Feeding',\n label: 'Feeding'\n},{\n value: 'Drinking',\n label: 'Drinking'\n},{\n value: 'Exploratory',\n label: 'Exploratory'\n},{\n value: 'Social',\n label: 'Social'\n},{\n value: 'Locomotion',\n label: 'Locomotion'\n},{\n value: 'Proximity',\n label: 'Proximity'\n},{\n value: 'Others',\n label: 'Others'\n}]\n\nexport {behaviors};\n","const posture = [{\n value: 'Lying',\n label: 'Lying'\n},{\n value: 'Sitting',\n label: 'Sitting'\n},{\n value: 'Kneeling',\n label: 'Kneeling'\n},{\n value: 'Standing',\n label: 'Standing'\n}]\n\n export {posture}","const confidence = [{\n value: 'No occlusion',\n label: 'No occlusion'\n },{\n value: 'Minor occlusion',\n label: 'Minor occlusion'\n },{\n value: 'Split occlusion',\n label: 'Split occlusion'\n },{\n value: 'End occlusion',\n label: 'End occlusion'\n },{\n value: 'Critical occlusion',\n label: 'Critical occlusion'\n }\n]\nexport {confidence};\n","import React from \"react\"; \nimport { Type } from 'react-bootstrap-table2-editor';\nimport {behaviors} from './behaviors'\nimport {posture} from './posture'\nimport {status} from './status'\nimport {confidence} from './confidence'\nimport Button from 'react-bootstrap/Button'\n\nconst columns = (remove_table_index) => [{\n dataField: \"id\",\n text: \"ID\",\n headerStyle: () => { return { width: \"40px\", left: 0 }; },\n editable: false,\n},{\n dataField: \"global_id\",\n text: \"Glo\",\n headerStyle: () => { return { width: \"70px\", left: 0}; }\n},{\n dataField: \"posture\",\n text: \"Posture\",\n editor: {\n type: Type.SELECT,\n options: posture,\n }\n},\n{\n dataField: \"behavior\",\n text: \"Behavior\",\n editor: {\n type: Type.SELECT,\n options: behaviors,\n }\n},{\n dataField: \"confidence\",\n text: \"Confidence\",\n editor: {\n type: Type.SELECT,\n options: confidence,\n }\n},{\n dataField: \"remove\",\n text: \"Del\",\n editable: false,\n headerStyle: () => { return { width: \"50px\", left: 0}; },\n headerFormatter: () => {return (\n
\n Del\n remove_table_index()}\n label=\"Del\"\n >\n \n
\n );},\n formatter: (cellContent, row) => {\n return (\n
\n remove_table_index(row.id)}\n label=\"Del\"\n >\n \n
\n );\n },\n}\n]\nexport {columns}\n \n","import React from \"react\"; \n\nexport default function Instructions(){\n return (\n
\n

Keybinds:

\n\n There are preset keybinds setup to make it easier to use the tool without having to click around. If done properly a combination of mouse and keyboard actions speed up the annotation process. \n



\n * 1 : Mode Switch: Behavior

\n * 2 : Mode Switch: Bounding Box

\n * 3 : Mode Switch: Segmentation (Currently Disabled)

\n * a : Add annotation

\n * e : Skip forward frame(s)

\n * q : Skip backward frame(s)

\n * w : Pause/Play

\n\n



\n

Uploading Video:

\n\n Ensure that you know the framerate of the video chosen to be annotated. These values should be entered into the settings tab into their \"frame rate\" fields. \n



\n Click on the right side browse button. All other buttons on the screen shuold be disabled until the video has been uploaded. Currenntly ```.mp4``` format is the best choice and tested for. Other file types such as .avi are supported but might have unintended bugs.\n

\n Please note that videos SHOULD be in 16:9 aspect ratio for best results. Extraneous behavior may occur if resolution is different.\n



\n\n

Uploading Image:

\n Select all of the image files needed for the various inputs. To select a group of images, they should be in the same folder.\n

\n Please note that images SHOULD be in 16:9 aspect ratio for best results. Extraneous behavior may occur if resolution is different.\n



\n

Annotations

\n

\n There are currently two kinds of annotations. \n



\n

Behavior Annotation:

\n\n This is for having annotations that do not have any visual attribute attached to it. This annotation is also attached by default when the bounding box or segmentation annotation is created. \n\n



\n

Bounding Box:

\n\n This forms a square around the desired object. There should be small squares at the edges of the bounding box which can be used to resize the box. The number on the top left of the box is used to identify the placement of the box in the table to the right.\n



\n
\n )\n}","import {createSlice} from '@reduxjs/toolkit'\n\nconst initialState = {data: []}\n\nconst frameDataSlice = createSlice({\n name: 'frame_data',\n initialState,\n reducers:{\n init(state, payload){\n var data = [];\n for(var i = 0; i < payload.payload; i++){\n data.push([]);\n }\n state.data = data;\n },\n initOldAnnotation(state, payload){\n state.data = payload.payload\n },\n modifyFrame(state, payload){\n var temp = state.data\n temp[payload.payload.currentFrame] = payload.payload.data\n state.data = temp\n },\n middleware: (getDefaultMiddleware) => getDefaultMiddleware({\n serializableCheck: false\n })\n }\n})\n\nexport const {init, modifyFrame} = frameDataSlice.actions\nexport default frameDataSlice.reducer\n","import {createSlice} from '@reduxjs/toolkit'\n\nconst initialState = {data: []}\n\nconst annotationDataSlice = createSlice({\n name: 'annotation_data',\n initialState,\n reducers:{\n init(state, payload){\n console.log(payload.payload)\n var data = [];\n for(var i = 0; i < payload.payload; i++){\n data.push([]);\n }\n state.data = data;\n },\n initOldAnnotation(state, payload){\n state.data = payload.payload\n },\n modifyFrame(state, payload){\n var temp = state.data\n temp[payload.payload.currentFrame] = payload.payload.data\n state.data = temp\n },\n middleware: (getDefaultMiddleware) => getDefaultMiddleware({\n serializableCheck: false\n })\n }\n})\n\nexport const {init, modifyFrame} = annotationDataSlice.actions\nexport default annotationDataSlice.reducer","import {createSlice} from '@reduxjs/toolkit'\n\nconst initialState = {data: undefined}\n\nconst columnDataSlice = createSlice({\n name: 'column_annot',\n initialState,\n reducers:{\n init(state, payload){\n console.log(payload.payload.data)\n state.data = payload.payload.data\n },\n middleware: (getDefaultMiddleware) => getDefaultMiddleware({\n serializableCheck: false\n })\n }\n})\n\nexport const {init} = columnDataSlice.actions\nexport default columnDataSlice.reducer","import {createSlice} from '@reduxjs/toolkit'\n\nconst initialState = {data: undefined}\n\nconst currFrameDataSlice = createSlice({\n name: 'current_frame',\n initialState,\n reducers:{\n init(state, payload){\n console.log(payload.payload.data)\n state.data = payload.payload.data\n },\n changeFrame(state, payload){\n state.data = payload.payload.data\n },\n middleware: (getDefaultMiddleware) => getDefaultMiddleware({\n serializableCheck: false\n })\n }\n})\n\nexport const {init} = currFrameDataSlice.actions\nexport default currFrameDataSlice.reducer","import {createSlice} from '@reduxjs/toolkit'\n\nconst initialState = {data: []}\n\nconst mediaDataSlice = createSlice({\n name: 'media_data',\n initialState,\nreducers:{\n init(state, payload){\n var data = [];\n for(var i = 0; i < payload.payload; i++){\n data.push([]);\n }\n state.data = data;\n },\n addMedia(state, payload){\n var temp = state.data\n var media = payload.payload.media\n temp[payload.payload.stream_num] = media\n state.data = temp\n },\n middleware: (getDefaultMiddleware) => getDefaultMiddleware({\n serializableCheck: false\n })\n }\n})\n\nexport const {init, modifyFrame} = mediaDataSlice.actions\nexport default mediaDataSlice.reducer","import store from '../store'\n\n/*\nAction functions for frame_data\n*/\nfunction initFrameData(frame_count){\n\tstore.dispatch({\n\t\ttype: \"frame_data/init\",\n\t\tpayload: frame_count\n\t})\n}\nfunction updateFrameData(frame_number, data){\n\tstore.dispatch({\n\t\ttype: \"frame_data/modifyFrame\",\n\t\tpayload: {currentFrame: frame_number, data: data}\n\t})\n}\nfunction getFrameData(frame_number){\n\tconsole.log(store.getState())\n\treturn JSON.parse(JSON.stringify(store.getState().frame_data.data[frame_number]))\n} \n\n/*\nAction functions for annotation_data\n*/\nfunction initAnnotationData(frame_count){\n store.dispatch({\n\t\ttype: \"annotation_data/init\",\n\t\tpayload: frame_count\n\t})\n}\nfunction updateAnnotationData(frame_number, data){\n store.dispatch({\n\t\ttype: \"annotation_data/modifyFrame\",\n\t\tpayload: {currentFrame: frame_number, data: data}\n\t})\n}\nfunction getAnnotationData(frame_number){\n return JSON.parse(JSON.stringify(store.getState().annotation_data.data[frame_number]))\n}\n\n/*\nAction functions for column uploading\n*/\nfunction initColumnData(column_dat){\n\tstore.dispatch({\n\t\ttype: \"column_annot/init\",\n\t\tpayload: {data: column_dat}\n\t})\n}\n\nfunction getColumnData(){\n\treturn JSON.parse(JSON.stringify(store.getState().column_annot))\n}\n\nfunction initCurrentFrame(frame_num){\n\tstore.dispatch({\n\t\ttype: \"current_frame/init\",\n\t\tpayload: {data: frame_num}\n\t})\n}\n\nfunction getCurrentFrame(){\n\treturn JSON.parse(JSON.stringify(store.getState().current_frame))['data']\n}\n\nfunction setCurrentFrame(frame_num){\n\tstore.dispatch({\n\t\ttype: \"current_frame/changeFrame\",\n\t\tpayload: {data: frame_num}\n\t})\n}\n\nfunction initMedia(num_streams){\n\tstore.dispatch({\n\t\ttype: \"media_data/init\",\n\t\tpayload: num_streams\n\t})\n}\n\nfunction setMedia(stream_num, media){\n\tstore.dispatch({\n\t\ttype: \"media_data/addMedia\",\n\t\tpayload: {stream_num: stream_num, media: media}\n\t})\n}\n\nfunction initMetadata(horizontal_res, vertical_res, frame_rate, media_type, total_frames){\n\tstore.dispatch({\n\t\ttype: \"metadata/init\",\n\t\tpayload: {horizontal_res: horizontal_res, vertical_res: vertical_res, frame_rate: frame_rate, media_type: media_type, total_frames: total_frames}\n\t})\n}\n\nfunction setRes(horizontal_res, vertical_res){\n\tstore.dispatch({\n\t\ttype: \"metadata/setRes\",\n\t\tpayload: {horizontal_res: horizontal_res, vertical_res: vertical_res}\n\t})\n}\n\nfunction setFrameRate(frame_rate){\n\tstore.dispatch({\n\t\ttype: \"metadata/setFrameRate\",\n\t\tpayload: {frame_rate: frame_rate}\n\t})\n}\n\nfunction setMediaType(media_type){\n\tstore.dispatch({\n\t\ttype: \"metadata/setMediaType\",\n\t\tpayload: {media_type: media_type}\n\t})\n}\n\nfunction setTotalFrames(total_frames){\n\tstore.dispatch({\n\t\ttype: \"metadata/setTotalFrames\",\n\t\tpayload: {total_frames: total_frames}\n\t})\n}\n\nfunction setSkipValue(skip_val){\n\tstore.dispatch({\n\t\ttype: \"metadata/setSkipValue\",\n\t\tpayload: {skip_value: skip_val}\n\t})\n}\n\nfunction getMetaData(){\n\treturn JSON.parse(JSON.stringify(store.getState().metadata))\n}\n\nfunction togglePlay(){\n\tstore.dispatch({\n\t\ttype: \"play_status/togglePlay\",\n\t\tpayload: {}\n\t})\n}\n\nfunction initPlay(){\n\tstore.dispatch({\n\t\ttype: \"play_status/init\",\n\t\tpayload: {}\n\t})\n}\n\nexport {initFrameData, \n\t\tupdateFrameData, \n\t\tgetFrameData, \n\t\tinitAnnotationData, \n\t\tupdateAnnotationData, \n\t\tgetAnnotationData, \n\t\tinitColumnData, \n\t\tgetColumnData,\n\t\tinitCurrentFrame,\n\t\tgetCurrentFrame,\n\t\tsetCurrentFrame,\n\t\tinitMedia,\n\t\tsetMedia, \n\t\tinitMetadata,\n\t\tsetRes, \n\t\tsetFrameRate,\n\t\tsetMediaType,\n\t\tsetTotalFrames,\n\t\tsetSkipValue,\n\t\tgetMetaData,\n\t\ttogglePlay,\n\t\tinitPlay\n\t}\n","import {createSlice} from '@reduxjs/toolkit'\nimport {initFrameData, updateFrameData, getFrameData, initAnnotationData, updateAnnotationData, getAnnotationData, initColumnData, setMedia, initMedia} from '../processing/actions'\n\n\nconst initialState = {horizontal_res: 0, vertical_res: 0, frame_rate: 1, media_type: \"in_video\", total_frames: 0, skip_value: 1}\n\nconst metadataSlice = createSlice({\n name: 'metadata',\n initialState,\n reducers:{\n init(state, payload){\n state.horizontal_res = payload.payload.horizontal_res\n state.vertical_res = payload.payload.vertical_res\n state.frame_rate = payload.payload.frame_rate\n state.media_type = payload.payload.media_type\n state.total_frames = payload.payload.total_frames\n },\n setRes(state, payload){\n state.horizontal_res = payload.payload.horizontal_res\n state.vertical_res = payload.payload.vertical_res\n },\n setFrameRate(state, payload){\n\t // When the frame rate is changed, we first calculate the current frame rate and then multiply the total frames by the ratio of the new frame rate to the old frame rate\n\t if (state.media_type != \"in_image\") { // only for videos\n\t\t var curr_framerate = JSON.parse(JSON.stringify(state))['frame_rate']\n\t\t state.total_frames = state.total_frames / curr_framerate\n\t\t state.total_frames = state.total_frames * payload.payload.frame_rate\n\t\t state.frame_rate = payload.payload.frame_rate\n\t }\n },\n setMediaType(state, payload){\n state.media_type = payload.payload.media_type\n },\n setTotalFrames(state, payload){\n state.total_frames = payload.payload.total_frames\n },\n setSkipValue(state, payload){\n state.skip_value = payload.payload.skip_value\n },\n middleware: (getDefaultMiddleware) => getDefaultMiddleware({\n serializableCheck: false\n })\n }\n})\n\nexport const {init, setRes, setFrameRate, setMediaType, setTotalFrames, setSkipValue} = metadataSlice.actions\nexport default metadataSlice.reducer\n","import {createSlice} from '@reduxjs/toolkit'\n\nconst initialState = {play: false}\n\nconst playStatusSlice = createSlice({\n name: 'play_status',\n initialState,\n reducers:{\n init(state, payload){\n state.play = false;\n },\n togglePlay(state, payload){\n state.play = !state.play\n },\n middleware: (getDefaultMiddleware) => getDefaultMiddleware({\n serializableCheck: false\n })\n }\n})\n\nexport const {init, togglePlay} = playStatusSlice.actions\nexport default playStatusSlice.reducer\n","import { configureStore } from '@reduxjs/toolkit'\nimport frameDataSlice from './reducer/frame_data'\nimport annotationDataSlice from './reducer/annotation_data'\nimport columnDataSlice from './reducer/column_annot'\nimport currFrameDataSlice from './reducer/current_frame'\nimport mediaDataSlice from './reducer/media_data'\nimport metadataSlice from './reducer/metadata'\nimport playStatusSlice from './reducer/play_status'\n\nexport default configureStore({\n reducer: {\n frame_data: frameDataSlice,\n annotation_data: annotationDataSlice,\n column_annot: columnDataSlice,\n current_frame: currFrameDataSlice,\n media_data: mediaDataSlice,\n metadata: metadataSlice,\n play_status: playStatusSlice,\n },\n devTools: process.env.NODE_ENV !== 'production',\n})\n","export default class ExportingAnnotation{\n constructor(annotation_data, width, height, VIDEO_METADATA, image_data){\n console.log(width)\n console.log(height)\n this.frame_data = annotation_data\n this.width = width\n this.height = height\n this.metadata = VIDEO_METADATA\n this.image_data = image_data\n }\n\n get_frame_json(){\n var standard_annot = new Array(this.frame_data.length)\n console.log(this.metadata)\n console.log(this.frame_data)\n for(var i = 0; i < this.frame_data.length; i++){\n var curr = []\n if(this.frame_data[i] == []){\n console.log(\"Exporting error\")\n continue;\n }\n var frame_objects = this.frame_data[i]\n if(frame_objects == undefined){\n console.log(\"Exporting error\")\n continue;\n }\n \n for(var j = 0; j < frame_objects.length; j++){\n try {\n console.log(frame_objects[j])\n if(frame_objects[j] == undefined || frame_objects[j]['type'] !== \"group\"){\n continue;\n }\n if (frame_objects[j]._objects == undefined){\n continue;\n }\n if(frame_objects[j]._objects[0]['type'] === \"rect\"){\n console.log(frame_objects[j])\n var x = (frame_objects[j]['left'] / this.width) * this.metadata['horizontal_res']\n var y = (frame_objects[j]['top'] / this.height) * this.metadata['vertical_res']\n var width = ((frame_objects[j]['width'] * frame_objects[j]['scaleX']) / this.width) * this.metadata['horizontal_res']\n var height = ((frame_objects[j]['height'] * frame_objects[j]['scaleY']) / this.height )* this.metadata['vertical_res']\n var local_id = frame_objects[j]._objects[1]['text']\n if(this.metadata.media_type == \"in_image\"){\n curr.push({\"type\": \"bounding_box\",\"x\": x, \"y\": y, \"width\": width, \"height\": height, \"local_id\": local_id,\"fileName:\": this.image_data[i]['name'], \"dataType\": \"image\"})\n }else{\n curr.push({\"type\": \"bounding_box\",\"x\": x, \"y\": y, \"width\": width, \"height\": height, \"local_id\": local_id, \"fileName:\": this.metadata['name'], \"dataType\": \"video\"})\n }\n //curr.push({\"type\": \"bounding_box\",\"x\": x, \"y\": y, \"width\": width, \"height\": height, \"local_id\": local_id})\n }else if (frame_objects[j]._objects[0]['type'] === \"polygon\"){\n var raw_points = frame_objects[j]._objects[0]['points']\n var points = []\n console.log(this.metadata)\n console.log(this.metadata['horizontal_res'])\n console.log(this.width)\n console.log(this.height)\n for(var k = 0; k < raw_points.length; k++){\n var x = (raw_points[k]['x'] / this.width) * this.metadata['horizontal_res']\n var y = (raw_points[k]['y'] / this.height) * this.metadata['vertical_res']\n points.push({\"x\": x, \"y\": y})\n }\n var local_id = frame_objects[j]._objects[1]['text']\n\n if(this.metadata.media_type == \"in_image\"){\n curr.push({\"type\": \"segmentation\", \"points\": points, \"local_id\": local_id, \"fileName:\": this.image_data[i]['name'], \"dataType\": \"image\"})\n }else{\n curr.push({\"type\": \"segmentation\", \"points\": points, \"local_id\": local_id, \"fileName:\": this.metadata['name'], \"dataType\": \"video\"})\n }\n //curr.push({\"type\": \"segmentation\", \"points\": points, \"local_id\": local_id})\n }else{\n alert(\"Error in exporting annotation. Please check the annotation and try again.\")\n }\n } catch (error) {\n console.log(error)\n }\n\n }\n\n standard_annot[i] = curr\n }\n return standard_annot\n }\n\n get_frame_json_fullCanvas(){\n var standard_annot = new Array(this.frame_data.length)\n console.log(this.metadata)\n for(var i = 0; i < this.frame_data.length; i++){\n var curr = []\n\n if(this.frame_data[i] == []){\n continue;\n }\n var frame_objects = this.frame_data[i]['objects']\n if(frame_objects == undefined){\n continue;\n }\n \n for(var j = 0; j < frame_objects.length; j++){\n console.log(frame_objects[j])\n if(frame_objects[j]['type'] !== \"group\"){\n continue;\n }\n if(frame_objects[j]['objects'][0]['type'] === \"rect\"){\n console.log(frame_objects[j])\n var x = (frame_objects[j]['left'] / this.width) * this.metadata['horizontal_res']\n var y = (frame_objects[j]['top'] / this.height) * this.metadata['vertical_res']\n var width = ((frame_objects[j]['width'] * frame_objects[j]['scaleX']) / this.width) * this.metadata['horizontal_res']\n var height = ((frame_objects[j]['height'] * frame_objects[j]['scaleY']) / this.height )* this.metadata['vertical_res']\n var local_id = frame_objects[j]['objects'][1]['text']\n if(this.image_data.length != 0){\n curr.push({\"type\": \"bounding_box\",\"x\": x, \"y\": y, \"width\": width, \"height\": height, \"local_id\": local_id,\"fileName:\": this.image_data[i]['name'], \"dataType\": \"image\"})\n }else{\n curr.push({\"type\": \"bounding_box\",\"x\": x, \"y\": y, \"width\": width, \"height\": height, \"local_id\": local_id, \"fileName:\": this.metadata['name'], \"dataType\": \"video\"})\n }\n //curr.push({\"type\": \"bounding_box\",\"x\": x, \"y\": y, \"width\": width, \"height\": height, \"local_id\": local_id})\n }else if (frame_objects[j]['objects'][0]['type'] === \"polygon\"){\n var raw_points = frame_objects[j]['objects'][0]['points']\n var points = []\n for(var k = 0; k < raw_points.length; k++){\n var x = (raw_points[k]['x'] / this.width) * this.metadata['horizontal_res']\n var y = (raw_points[k]['y'] / this.height) * this.metadata['vertical_res']\n points.push({\"x\": x, \"y\": y})\n }\n var local_id = frame_objects[j]['objects'][1]['text']\n\n if(this.image_data.length != 0){\n curr.push({\"type\": \"segmentation\", \"points\": points, \"local_id\": local_id, \"fileName:\": this.image_data[i]['name'], \"dataType\": \"image\"})\n }else{\n curr.push({\"type\": \"segmentation\", \"points\": points, \"local_id\": local_id, \"fileName:\": this.metadata['name'], \"dataType\": \"video\"})\n }\n //curr.push({\"type\": \"segmentation\", \"points\": points, \"local_id\": local_id})\n }\n\n }\n\n standard_annot[i] = curr\n }\n return standard_annot\n }\n\n get_frame_coco(){\n\n }\n}","import React, { useEffect } from 'react';\nimport { useState } from 'react';\nimport \"bootstrap/dist/css/bootstrap.min.css\";\n\nimport Navbar from 'react-bootstrap/Navbar'\nimport Nav from 'react-bootstrap/Nav'\nimport Button from 'react-bootstrap/Button'\nimport { NavDropdown, NavLink } from 'react-bootstrap';\nimport Form from 'react-bootstrap/Form'\nimport Dropdown from 'react-bootstrap/Dropdown'\nimport { ButtonGroup } from 'react-bootstrap';\nimport Modal from 'react-bootstrap/Modal'\n\nimport \"react-datepicker/dist/react-datepicker.css\";\n\nimport Instructions from './instructions';\nimport { downloadFileJSON} from '../../processing/download';\n\nimport ExportingAnnotation from '../../processing/exporting_annotation';\nimport ProcessVideo from './process_video';\nimport store from '../../store' \nimport {INPUT_IMAGE, INPUT_VIDEO} from '../../static_data/const'\nimport { useSelector } from \"react-redux\";\n\nimport {initFrameData, updateFrameData, getFrameData, initAnnotationData, updateAnnotationData, getAnnotationData, initColumnData, setMedia, initMedia, setFrameRate, setMediaType, setSkipValue, getMetaData, togglePlay} from '../../processing/actions'\n\ninitMedia(1)\nexport default function CustomNavBar(props){\n\tconst [show, setShow] = useState(false);\n\tconst [uploadShow, setUploadShow] = useState(true);\n\tconst [videoFormat, setVideoFormat] = useState(INPUT_VIDEO)\n\tconst [process, setProcess] = useState(false)\n\tconst [columnLoad, setColumnLoad] = useState(false)\n\tconst [numStrems, setNumStreams] = useState(1)\n\tconst [playText, setPlayText] = useState(false)\n\n\tconst handleClose = () => setShow(false);\n\tconst handleShow = () => setShow(true);\n\tconst handleUploadClose = () => {setUploadShow(false); setProcess(true)}\n\tconst handleUploadShow = () => {\n\t\tsetUploadShow(true)\n\t}\n\tconst play_redux = useSelector(state => state.play_status.play)\n\n\tconst handleDownloadJSON = () => {\n\t\tvar converted_annot = new ExportingAnnotation(store.getState().frame_data.data, props.video_width, props.video_height, getMetaData(), store.getState().media_data.data[0]).get_frame_json()\n\t\tconsole.log(converted_annot)\n\t\tdownloadFileJSON(converted_annot, getMetaData())\n\t}\n\tconst handleVideoFormat = (type) => {\n\t\t//TODO Make sure bug is resolved and simply have video format equal type\n\t\t//type = parseInt(type)\n\t\tif(type === INPUT_VIDEO){\n\t\t\tsetVideoFormat(INPUT_VIDEO)\n\t\t\tsetMediaType(INPUT_VIDEO)\n\t\t}else if (type === INPUT_IMAGE){\n\t\t\tsetVideoFormat(INPUT_IMAGE)\n\t\t\tsetMediaType(INPUT_IMAGE)\n\t\t}else {\n\t\t\talert(\"Wrong input detected - please report this bug.\")\n\t\t}\n\t}\n\n\tconst convertFileToURLBlob = (file) => {\n\t\treturn URL.createObjectURL(file)\t\n\t}\n\n\tconst handleMediaUpload = (event) => {\n\t\tif(videoFormat == INPUT_VIDEO){\n\t\t\tsetMedia(parseInt(event.target.id), event.target.files)\n\t\t}else{\n\t\t\tsetMedia(parseInt(event.target.id), event.target.files)\n\t\t}\n\t}\n\n\tconst handleColumnUpload = (event) => {\n\t\tvar promise = downloadColumn(event)\n\t\tpromise.then(function (result) {\n\t\t\tif(result['columns'] == undefined){\n\t\t\t\talert(\"Error in processing columns. Please check the file and try again.\")\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(result != null){\n\t\t\t\tsetColumnLoad(true);\n\t\t\t\tinitColumnData(result)\n\t\t\t}else{\n\t\t\t\talert(\"Error in processing columns. Please check the file and try again.\")\n\t\t\t\treturn;\n\t\t\t}\n\t\t})\n\t}\n\n\tconst downloadColumn = (file) => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tvar reader = new FileReader();\n\t\t\treader.onload = function(e) {\n\t\t\t\tresolve((JSON.parse(e.target.result)));\n\t\t\t}\n\t\t\treader.readAsText(file.target.files[0])\n\t\t})\n\t}\n\n\tconst handleStreamNumChange = (event) => {\n\t\tsetNumStreams(event.target.value)\n\t\tinitMedia(event.target.value)\n\t}\n\n\tconst generateUploadButtons = () => {\n\t\tvar uploadButtons = []\n\t\tfor(var i = 0; i < numStrems; i++){\n\t\t\tlet button_image = (\n\t\t\t\t
\n\t\t\t\t\t {handleMediaUpload(event)}} />\n\t\t\t\t\n\t\t\t)\n\t\t\tlet button_video = (\n\t\t\t\t
\n\t\t\t\t\t {handleMediaUpload(event)}} />\n\t\t\t\t\n\t\t\t)\n\t\t\tif (videoFormat === INPUT_IMAGE){\n\t\t\t\tuploadButtons.push(button_image)\n\t\t\t}else if (videoFormat === INPUT_VIDEO){\n\t\t\t\tuploadButtons.push(button_video)\n\t\t\t}\n\t\t}\n\t\treturn (\n\t\t\t
\n\t\t\t{\n\t\t\t\tuploadButtons.map((but, _) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tbut\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t}\n\t\t\t
\n\t\t)\n\t}\n\n\tconst handlePlaying = (event) => {\n\t\ttogglePlay()\n\t}\n\n\tuseEffect(() => {\n\t\tif (play_redux == false){\n\t\t\tsetPlayText(\"Play\")\n\t\t}else {\n\t\t\tsetPlayText(\"Pause\")\n\t\t}\n\t}, [play_redux])\n\n\treturn (\n\t\t
\n\t\t\n\t\t\t\n\t\t\tInstructions\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\tUpload\n\t\t\t\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t{/*onClick and onBlur events are for the sole purpose to stop the eventKeys from firing off*/}\n\t\t\t\t\t
\n\t\t\t\t\t\tMedia Format: \n\t\t\t\t\t\t{handleVideoFormat(event.target.value)}}\n\t\t\t\t\t\t\tdefaultValue={videoFormat}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tStream Num: {props.toggleKeyCheck(false)}} onBlur={(event) => {props.toggleKeyCheck(true)}} onChange={handleStreamNumChange}>\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t{\n\t\t\t\t\t\tgenerateUploadButtons()\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tFrame Rate: {props.toggleKeyCheck(false)}} onBlur={(event) => {props.toggleKeyCheck(true)}} onChange={(event) => {setFrameRate(event.target.value);}}>\n\t\t\t\t\t\n\t\t\t\t\tSkip Value: {setSkipValue(event.target.value)}}>\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t
\n\t\t\n\t\t\t\tAVAT\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t{' '}\n\t\t\t\t\t{' '}\n\t\t\t\t\t\n\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tSkip Value: {setSkipValue(event.target.value)}}>\n\t\t\t\t\t\t\n\t\t\t\t\t{' '}\n\t\t\t\t\t\n\t\t\t\t\t{' '}\n\t\t\t\t\t{\n\t\t\t\t\t\tvideoFormat === INPUT_VIDEO && \n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t{' '}\n\t\t\t\t\t{' '}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{props.change_annotation_type(\"1\")}}>Behavior Annotation\n\t\t\t\t\t\t\t{props.change_annotation_type(\"2\")}}>BoundingBox\n\t\t\t\t\t\t\t{props.change_annotation_type(\"3\")}}>Segmentation\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{/*{' '}*/}\n\t\t\t\t
\n\t\t
\n\t\t
\n\t)\n}\n","let INPUT_IMAGE = \"in_image\"\nlet INPUT_VIDEO = \"in_video\"\n\nexport {INPUT_IMAGE, INPUT_VIDEO}","import store from '../store'\nimport {getFrameData, getAnnotationData} from './actions'\n\nexport async function downloadFileJSON (frame_data, VIDEO_METADATA) {\n var fileName = \"generated_annotations\";\n \n const json = JSON.stringify({\"vid_metadata\": VIDEO_METADATA, \"annotations\": frame_data, \"behavior_data\": store.getState().annotation_data.data})\n //var json = JSON.stringify(frame_data);\n var blob = new Blob([json],{type:'application/json'});\n var href = await URL.createObjectURL(blob);\n var link = document.createElement('a');\n link.href = href;\n link.download = fileName + \".json\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n}\n\n\n//Legacy code below - Can be refrenced later IF need for CSV is present. Currently broken.\nfunction convert_data_csv(data, columns){\n console.log(columns)\n var csv = new Array(data.length + 1)\n for(var i = 0; i < csv.length; i++){\n csv[i] = []\n }\n csv[0].push(\"frame_num\")\n for(var i = 0; i < columns.length; i++){\n csv[0].push(columns[i]['dataField'])\n }\n for(var i = 0; i < data.length; i++){\n for(var j = 0; j < data[i].length; j++){\n csv[i+1][j]=[];\n var obj = data[i][j]\n var vals = Object.keys((obj)).map(function (key) { return obj[key]; });\n csv[i+1][j] = i + \",\" + vals.join(\",\")\n }\n csv[i+1] = csv[i+1].join(\"\\n\")\n }\n csv = csv.join(\"\\n\")\n return csv\n}\n\nexport async function downloadFileCSV (ANNOTATION_VIDEO_NAME, ANNOTATOR_NAME, annotation_data, columns) {\n var fileName = \"generated_annotations\";\n if(ANNOTATION_VIDEO_NAME !== \"\" && ANNOTATOR_NAME !== \"\"){\n fileName = ANNOTATION_VIDEO_NAME.split('.').slice(0, -1).join('.') + \"_\" + ANNOTATOR_NAME\n }\n var csv = convert_data_csv(annotation_data, columns(\"\"))\n var blob = new Blob([csv],{type:'application/octet-stream'});\n var href = await URL.createObjectURL(blob);\n var link = document.createElement('a');\n link.href = href;\n link.download = fileName + \".csv\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n}","import React, { useEffect, useState } from \"react\"; \nimport ReactDOM from 'react-dom'\n\nimport store from '../../store' \nimport {initFrameData, updateFrameData, getFrameData, \n\t\tinitAnnotationData, updateAnnotationData, getAnnotationData, \n\t\tinitColumnData, getColumnData, \n\t\tinitCurrentFrame, getCurrentFrame, setCurrentFrame, setTotalFrames,} from '../../processing/actions'\nimport { useSelector } from \"react-redux\";\n\nimport {INPUT_IMAGE, INPUT_VIDEO} from '../../static_data/const'\nconst fabric = require(\"fabric\").fabric;\n\n\nconst canvasBackgroundUpdate = (currFrameData, inputType, image_url, scaling_factor_width, scaling_factor_height, fabricCanvas, remove_obj=true) => {\n\tif(inputType == INPUT_IMAGE){ //This is for when images are uploaded\n\t\tvar img = new Image()\n\t\timg.onload = function() {\n\t\t\tif (remove_obj){\n\t\t\t\tfabricCanvas.clear();\n\t\t\t}\n\t\t\tif(currFrameData != undefined){\n\t\t\t\tfabric.util.enlivenObjects(currFrameData, function (enlivenedObjects){\n\t\t\t\t\tenlivenedObjects.forEach(function (obj, index) {\n\t\t\t\t\t\tfabricCanvas.add(obj);\n\t\t\t\t\t});\n\t\t\t\t\tfabricCanvas.renderAll();\n\t\t\t\t})\n\t\t\t}\n\t\t\tvar f_img = new fabric.Image(img, {\n\t\t\t\tobjectCaching: false,\n\t\t\t\tscaleX: scaling_factor_width / img.width,\n\t\t\t\tscaleY: scaling_factor_height / img.height\n\t\t\t});\n\t\t\tfabricCanvas.setBackgroundImage(f_img);\n\t\t\n\t\t\tfabricCanvas.renderAll();\n\t\t};\n\t\timg.src = URL.createObjectURL(image_url)\n\t\treturn;\n\t}else{ //This is for videos\n\t\tif (remove_obj){\n\t\t\tfabricCanvas.remove(...fabricCanvas.getObjects());\n\t\t}\n\t\tif(currFrameData != undefined){\n\t\t\tfabric.util.enlivenObjects(currFrameData, function (enlivenedObjects){\n\t\t\t\tenlivenedObjects.forEach(function (obj, index) {\n\t\t\t\t\tfabricCanvas.add(obj);\n\t\t\t\t});\n\t\t\t\tfabricCanvas.renderAll();\n\t\t\t})\n\t\t}\n\t\tfabricCanvas.renderAll();\n\t}\n}\n\nexport default function FabricRender(props){\n\tconst [fabricCanvas, setFabricCanvas] = useState(null)\n\tconst [currindex, setCurrindex] = useState(0)\n\tconst [upload, setUpload] = useState(false)\n\tconst [frameToUpdate, setFrameToUpdate] = useState(0)\n\tconst metadata_redux = useSelector(state => state.metadata)\n\tconst frame_redux = useSelector(state => state.frame_data)\n\tconst image_data_store = useSelector(state => state.media_data)\n\tconst currFrame = useSelector(state => state.current_frame)\n\tconst currframe_redux = currFrame['data']\n\tconst play_redux = useSelector(state => state.play_status.play)\n\tconst image_data = image_data_store['data'][props.stream_num]\n\n\tconst save_data = (frame_number, reason) => {\n\t\tif(fabricCanvas){\n\t\t\tconsole.log('SAVING DATA FOR FRAME', frame_number, reason)\n\t\t\tupdateFrameData(frame_number, fabricCanvas.getObjects())\n\t\t}\n\t}\n\n\tuseEffect(() => {\n\t\tvar temp_fabricCanvas = (new fabric.Canvas('c', {\n\t\t\tuniScaleTransform: true,\n\t\t\tuniformScaling: false,\n\t\t\tincludeDefaultValues: false\n\t\t}));\n\n\t\tfabric.Image.prototype.toObject = (function(toObject) {\n\t\t\treturn function() {\n\t\t\t\treturn fabric.util.object.extend(toObject.call(this), {\n\t\t\t\t\tsrc: this.toDataURL()\n\t\t\t\t});\n\t\t\t};\n\t\t})(fabric.Image.prototype.toObject);\n\n\t\ttemp_fabricCanvas.on('mouse:wheel', function(opt) {\n\t\t\tvar delta = opt.e.deltaY;\n\t\t\tvar zoom = temp_fabricCanvas.getZoom();\n\t\t\tzoom *= 0.999 ** delta;\n\t\t\tif (zoom > 20) zoom = 20;\n\t\t\tif (zoom < 0.01) zoom = 0.01;\n\t\t\ttemp_fabricCanvas.zoomToPoint({ x: opt.e.offsetX, y: opt.e.offsetY }, zoom);\n\t\t\topt.e.preventDefault();\n\t\t\topt.e.stopPropagation();\n\t\t});\n\n\t\ttemp_fabricCanvas.on('object:moving', function (event) {\n\t\t\tthis.objDrag = true;\n\t\t});\n\n\t\ttemp_fabricCanvas.on('mouse:down', function(opt) {\n\t\t\tvar evt = opt.e;\n\t\t\tif (evt.altKey === true) {\n\t\t\t\tthis.isDragging = true;\n\t\t\t\tthis.selection = false;\n\t\t\t\tthis.lastPosX = evt.clientX;\n\t\t\t\tthis.lastPosY = evt.clientY;\n\t\t\t}\n\t\t});\n\t\ttemp_fabricCanvas.on('mouse:move', function(opt) {\n\t\t\tif (this.isDragging) {\n\t\t\t\tvar e = opt.e;\n\t\t\t\tvar vpt = this.viewportTransform;\n\t\t\t\tvpt[4] += e.clientX - this.lastPosX;\n\t\t\t\tvpt[5] += e.clientY - this.lastPosY;\n\t\t\t\tthis.requestRenderAll();\n\t\t\t\tthis.lastPosX = e.clientX;\n\t\t\t\tthis.lastPosY = e.clientY;\n\t\t\t}\n\t\t});\n\t\ttemp_fabricCanvas.on('mouse:up', function(opt) {\n updateFrameData(currframe_redux, temp_fabricCanvas.getObjects())\n if(this.objDrag){\n\t\t\t\tthis.objDrag = false;\n\t\t\t}\n\t\t\tthis.setViewportTransform(this.viewportTransform);\n\t\t\tthis.isDragging = false;\n\t\t\tthis.selection = true;\n\t\t});\n\n\t\tvar el = ReactDOM.findDOMNode(this);\n\t\tvar canvas_elem = document.getElementsByTagName('canvas')[props.stream_num*2]\n\t\ttemp_fabricCanvas.initialize(canvas_elem, {\n\t\t\theight: props.scaling_factor_height,\n\t\t \twidth: props.scaling_factor_width,\n\t\t \tbackgroundColor : null,\n\t\t});\n\n\t\tsetFabricCanvas(temp_fabricCanvas)\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif(fabricCanvas){\n\t\t\tsave_data(frameToUpdate, \"frame_change\")\n\t\t\tsetFrameToUpdate(currframe_redux) \n\t\t\tvar video = document.getElementsByTagName('video')[props.stream_num]\n\t\t\tif(upload == true){\n\t\t\t\tvideo.currentTime = (video.duration * ((currframe_redux+1)/metadata_redux['total_frames']))\t\t\t\n\t\t\t}\n\t\t\tif(metadata_redux['media_type'] == INPUT_VIDEO){\n\t\t\t\tcanvasBackgroundUpdate(getFrameData(currframe_redux), INPUT_VIDEO, image_data[0], props.scaling_factor_width, props.scaling_factor_height, fabricCanvas)\n\t\t\t}else if (metadata_redux['media_type'] == INPUT_IMAGE){\n\t\t\t\tcanvasBackgroundUpdate(getFrameData(currframe_redux), INPUT_IMAGE, image_data[currframe_redux], props.scaling_factor_width, props.scaling_factor_height, fabricCanvas)\n\t\t\t}\n\t\t}\n\t}, [currFrame])\n\n\tuseEffect(() => {\n\t\tif (upload==false){\n\t\t\treturn\n\t\t}\n\t\tvar video = document.getElementsByTagName('video')[props.stream_num]\n\t\tif(play_redux){\n\t\t\tsave_data(frameToUpdate, \"play\")\n\t\t\tvideo.play()\n\t\t\tfabric.util.requestAnimFrame(function renderLoop() {\n\t\t\t\tfabricCanvas.renderAll();\n\t\t\t \tfabric.util.requestAnimFrame(renderLoop);\n\t\t\t});\n\t\t}else{\n\t\t\tvideo.pause()\n\t\t\tlet frame_number = Math.ceil((video.currentTime / video.duration) * metadata_redux['total_frames'])\n\t\t\tconsole.log(\"FRAME NUMBER\", frame_number)\n\t\t\tsetCurrentFrame(frame_number)\n\t\t}\n\t}, [play_redux])\n\n\n\tuseEffect(() => {\n\t\t// We want to redraw when a annotation is added or removed. Unfortunately this also causes a redraw when the current frame is changed.\n\t\t// This is not ideal, but it is a good enough solution for now. This should NOT save the data.\n\n\t\tif(fabricCanvas){\n\t\t\tcanvasBackgroundUpdate(getFrameData(currframe_redux), metadata_redux['media_type'], image_data[currframe_redux], props.scaling_factor_width, props.scaling_factor_height, fabricCanvas)\n\t\t}\n\t}, [frame_redux])\n\n\t\n\tif(fabricCanvas != null && image_data != undefined && upload===false && play_redux===false){\n\t\tif(image_data.length > 0){\n\t\t\tif(metadata_redux['media_type'] == INPUT_VIDEO){\n\t\t\t\tvar video = document.getElementsByTagName('video')[props.stream_num]\n\t\t\t\tvar source = document.createElement('source');\n\t\t\t\tsource.src = URL.createObjectURL(image_data[0])\n\t\t\t\tsource.type = \"video/mp4\"\n\t\t\t\tvideo.appendChild(source)\n\t\t\t\tvideo.onloadedmetadata = function(){\n\t\t\t\t\tinitAnnotationData(parseInt(video.duration))\n\t\t\t\t\tinitFrameData(parseInt(video.duration))\n\t\t\t\t\tsetTotalFrames(parseInt(video.duration))\n\t\t\t\t\tvideo.currentTime=0\n\t\t\t\t}\n\t\t\t\tvideo.oncanplaythrough = function(){\n\t\t\t\t\tif(upload === false){\n\t\t\t\t\t\tvar new_vid = new fabric.Image(video, {\n\t\t\t\t\t\t\tobjectCaching: false,\n\t\t\t\t\t\t\tscaleX: props.scaling_factor_width / video.videoWidth,\n\t\t\t\t\t\t\tscaleY: props.scaling_factor_height / video.videoHeight\n\t\t\t\t\t\t})\n\t\t\t\t\t\tvideo.width = video.videoWidth\n\t\t\t\t\t\tvideo.height = video.videoHeight\n\t\t\t\t\t\tfabricCanvas.setBackgroundImage(new_vid);\n\t\t\t\t\t\tfabricCanvas.renderAll();\n\t\t\t\t\t}\n\t\t\t\t\tsetUpload(true)\n\t\t\t\t}\n\t\t\t}else if(metadata_redux['media_type'] == INPUT_IMAGE){\n\t\t\t\tcanvasBackgroundUpdate(getFrameData(currframe_redux), INPUT_IMAGE, image_data[currframe_redux], props.scaling_factor_width, props.scaling_factor_height, fabricCanvas)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn(\n\t\t
\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t)\n\t\t //}\n}\n","import React from 'react'\nimport {initFrameData, updateFrameData, getFrameData, initAnnotationData, updateAnnotationData, getAnnotationData} from '../../processing/actions'\n\nimport { useTable, usePagination } from 'react-table'\n\nexport default function AnnotTable({columns, data, select_data, current_frame, change_annot}){\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n } = useTable({\n columns,\n data,\n })\n if(!columns){\n return (\n
\n {\"No column upload detected.\"}\n
\n )\n }\n\n return(\n \n \n {headerGroups.map(headerGroup => (\n \n {headerGroup.headers.map(column => (\n \n ))}\n \n ))}\n \n \n {rows.map((row, i) => {\n prepareRow(row)\n const {id, global_id, posture, behavior, confidence} = row\n var selection = genSelection(row.original, select_data, columns, i, current_frame)\n return(selection)\n })}\n \n
{column.render('Header')}
\n )\n}\n\nconst change_row = (e) => {\n var curr_data = getAnnotationData(e.target.dataset.curr)\n if (curr_data.length === 0){\n alert(\"Row changing value failed - please report this bug.\")\n return;\n }\n curr_data[e.target.id][e.target.dataset.type] = e.target.value\n updateAnnotationData(parseInt(e.target.dataset.curr), curr_data)\n}\n\nconst delete_row = (e) => {\n var curr_data = getAnnotationData(e.target.dataset.curr)\n if (curr_data.length === 0){\n alert(\"Row deletion failed - please report this bug.\")\n return;\n }\n var annot_delte = curr_data[e.target.id]['id']\n console.log(annot_delte)\n curr_data.splice(e.target.id, 1)\n updateAnnotationData(parseInt(e.target.dataset.curr), curr_data)\n var curr_img_data = getFrameData(e.target.dataset.curr)\n for(var i = 0; i < curr_img_data.length; i++){\n if(curr_img_data[i].objects[1].text == annot_delte){\n curr_img_data.splice(i, 1)\n }\n }\n updateFrameData(parseInt(e.target.dataset.curr), curr_img_data)\n}\n\nfunction genSelection(elem, select_data, columns, curr_idx, current_frame){\n var row_vals = []\n console.log(current_frame)\n for(var i = 0; i < columns[0].columns.length; i++){\n var curr_elem = columns[0].columns[i]['accessor']\n if(!check_keys(select_data, curr_elem)){\n continue\n }\n let temp = (\n \n )\n row_vals.push(temp)\n }\n \n let combined_elems = (\n \n {elem.id}\n \n \n \n {\n row_vals.map((i, j) => {\n return({i})\n })\n }\n \n \n \n \n )\n return combined_elems\n}\n\nfunction check_keys(obj, key){\n let obj_keys = Object.keys(obj)\n for(var i = 0; i < obj_keys.length; i++){\n if(obj_keys[i] === key){\n return true\n }\n }\n return false\n}\n","import React from \"react\"; \nimport 'bootstrap/dist/css/bootstrap.min.css';\n\nimport BootstrapTable from 'react-bootstrap-table-next';\nimport cellEditFactory, { Type } from 'react-bootstrap-table2-editor';\nimport 'react-bootstrap-table-next/dist/react-bootstrap-table2.min.css';\nimport paginationFactory from 'react-bootstrap-table2-paginator';\n\nimport Tabs from 'react-bootstrap/Tabs'\nimport Tab from 'react-bootstrap/Tab'\nimport Button from 'react-bootstrap/Button'\nimport { FormControl } from \"react-bootstrap\";\n\nimport AnnotTable from './annot_table'\nimport SwapAnnotTable from \"./cumulative_annot_table\";\n\nimport store from '../../store'\n\nfunction getAnnotationTableCount() {\n var annotation_data = store.getState().annotation_data.data\n var data = []\n if (!annotation_data){\n return data\n }\n for(var i = 0; i < annotation_data.length; i++){\n if(annotation_data[i].length !== 0){\n var txt_id = \"\"\n var txt_global = \"\"\n for(var j = 0; j < annotation_data[i].length; j++){\n txt_id += (annotation_data[i][j]['id']) + ', '\n txt_global += (annotation_data[i][j]['global_id']) + ', '\n }\n data.push({frame_num: i, anno_count: annotation_data[i].length, local_ids: txt_id, global_ids: txt_global})\n }\n }\n return data\n}\n\n\nexport default function AnnotationTable(props){\n var annotation_data = (props.annotation_data)\n var columns = []\n var col = []\n var select_data = undefined\n if(store.getState().column_annot.data != undefined){\n col = store.getState().column_annot.data['columns']\n select_data = store.getState().column_annot.data['select_data']\n columns.push(col)//hookBypass(col)\n }\n const anno_col = React.useMemo(\n () => [\n {\n Header: 'Name',\n columns: [\n {\n Header: 'Frame',\n accessor: 'frame_num',\n },\n {\n Header: 'Count',\n accessor: 'anno_count',\n },\n {\n Header: 'Local ID',\n accessor: 'local_id',\n },\n {\n Header: 'Global ID',\n accessor: 'global_ids',\n },\n /*{\n Header: 'Swap',\n accessor: 'swap',\n }*/\n ],\n }\n ],\n []\n )\n\n //TODO Add in force option for user to upload some sort of config file to continue along to next steps.\n return (\n
\n {\n col.length != 0 &&\n \n \n \n \n\n \n } \n
\n \n )\n}\n/*\n \n \n \n*/\n/*\n\n
No recorded annotations or behaviors for this video.
}\n pagination={ paginationFactory() }\n />\n
\n*/","//Core imports\nimport React, { useEffect, useState } from \"react\";\nimport 'bootstrap/dist/css/bootstrap.min.css';\n\n//Constants\nimport {INPUT_IMAGE, INPUT_VIDEO} from '../../static_data/const'\n\n//UI Element imports\nimport Toast from 'react-bootstrap/Toast'\n\n//Processing\nimport ExtractingAnnotation from '../../processing/annotation-processing'\n\n//Annotations\nimport { BoundingBox } from '../../annotations/bounding_box'\n\n//Column information + data structure\nimport {columns} from '../../static_data/columns'\nimport {ANNOTATION_FRAME, ANNOTATION_BBOX, ANNOTATION_KEYPOINT, ANNOTATION_SEG} from '../../static_data/constants'\n\n//Components\nimport CustomNavBar from \"../Components/nav_bar\";\nimport FabricRender from \"../Components/fabric_canvas\";\nimport AnnotationTable from \"../Components/change_table\";\n\n\n//Redux\nimport store from '../../store' \nimport {initFrameData, updateFrameData, getFrameData, \n\t\tinitAnnotationData, updateAnnotationData, getAnnotationData, \n\t\tgetColumnData,\n\t\tinitCurrentFrame, getCurrentFrame, setCurrentFrame,\n\t\tinitMedia,\n\t\tinitMetadata, setRes, setFrameRate, setTotalFrames,\n initColumnData,\n\t\tinitPlay} from '../../processing/actions'\nimport { useSelector } from \"react-redux\";\n\n// Data imports\nimport default_column from '../../static_data/basic_column_config.json'\n\nconst fabric = require(\"fabric\").fabric;\n\n//TODO ADD DYNAMIC SOLUTION\nvar scaling_factor_width = 1920;\nvar scaling_factor_height = 1080;\n\n//var current_screen_width = window.screen.width;\nvar current_screen_height = window.screen.height;\n\nif(current_screen_height >= 1080){////Mappings are based off of https://en.wikipedia.org/wiki/List_of_common_resolutions make sure to use 1:1 and 16:9 aspect ratio\n scaling_factor_width = 1280;\n scaling_factor_height = 720;\n}else if(current_screen_height >= 1024){\n scaling_factor_width = 1152;\n scaling_factor_height = 648;\n}else if(current_screen_height >= 768){\n scaling_factor_width = 1024;\n scaling_factor_height = 576;\n}\n\nvar upload = false;\nvar disable_buttons = true;\nvar toast_text = \"\"\nvar ANNOTATION_VIDEO_NAME = \"\"\nvar VIDEO_METADATA = {}\nvar play_button_text = \"Play\"\nvar segmentation_flag = false;\n\n//TODO remove after fixing null exceptions\ninitAnnotationData(1)\ninitFrameData(1)\ninitCurrentFrame(0)\ninitMetadata(scaling_factor_width, scaling_factor_height, 1, INPUT_VIDEO, 1)\ninitPlay()\nconsole.log(default_column)\ninitColumnData(\n default_column\n)\n\n//Current frame counter\nexport default function MainUpload() {\n\tconst [visualToggle, setVisualToggle] = useState(0);\n\tconst [annotationType, setAnnotationType] = useState(\"1\")\n\tconst [boxCount, setBoxCount] = useState(0)\n\tconst [oldAnnotation, setOldAnnotation] = useState(null)\n\tconst [save, changeSave] = useState(false);\n\tconst [keyCheck, changeKeyCheck] = useState(true)\n\tconst [isLoading, setIsLoading] = useState(true)\n\n\t//New state vars\n\tconst [currAnnotationData, setCurrAnnotationData] = useState([])\n\n\tconst annot_redux = useSelector(state => state.annotation_data.data)\n\tconst column_redux = useSelector(state => state.column_annot.data)\n\tconst currframe_redux = useSelector(state => state.current_frame)['data']\n\tconst imagedata_redux = useSelector(state => state.media_data.data)\n\tconst metadata_redux = useSelector(state => state.metadata)\n\tvar inputType = metadata_redux['media_type']\n\tvar skip_value = parseInt(metadata_redux['skip_value'])\n\n\tuseEffect(() => {\n\t\tif(upload == true){\n\t\t\tvar annot = getAnnotationData(currframe_redux)\n\t\t\tsetCurrAnnotationData(annot)\n\t\t}\n\t}, [currframe_redux])\n\n\tuseEffect(()=>{\n\t\tif(annot_redux.length === 1){\n\t\t\tinitAnnotationData(metadata_redux.total_frames)\n\t\t\tinitFrameData(metadata_redux.total_frames)\n\t\t}\n\t}, [metadata_redux]);\n\n\tuseEffect(() => {\n\t\tif(imagedata_redux[0].length != 0){\n\t\t\tif(metadata_redux['media_type'] == INPUT_IMAGE){\n\t\t\t\tsetTotalFrames(imagedata_redux[0].length)\n\t\t\t\tupload = true\n\t\t\t\tdisable_buttons = false\n\t\t\t\tinitAnnotationData(imagedata_redux[0].length)\n\t\t\t\tinitFrameData(imagedata_redux[0].length)\n\t\t\t\tvar url = (imagedata_redux[0][0])\n\t\t\t\tvar img = new Image;\n\t\t\t\timg.onload = function() {\n\t\t\t\t\tVIDEO_METADATA = {\"horizontal_res\": img.width, \"vertical_res\": img.height}\n\t\t\t\t\tURL.revokeObjectURL(img.src)\n\t\t\t\t}\n\t\t\t\timg.src = url\n\t\t\t\tsetVisualToggle(10)\n\t\t\t}else if(metadata_redux['media_type'] == INPUT_VIDEO){\n\t\t\t\tupload = true\n\t\t\t\tdisable_buttons = false\n\t\t\t\tinitAnnotationData(imagedata_redux[0].length)\n\t\t\t\tinitFrameData(imagedata_redux[0].length)\n\t\t\t\tsetVisualToggle(10)\n\t\t\t}\n\t\t}\n\t\tscaling_factor_width = 1920;\n\t\tscaling_factor_height = 1080;\n\t\tif(current_screen_height >= 1080){////Mappings are based off of https://en.wikipedia.org/wiki/List_of_common_resolutions make sure to use 1:1 and 16:9 aspect ratio\n\t\t\tscaling_factor_width = 1280;\n\t\t\tscaling_factor_height = 720;\n\t\t }else if(current_screen_height >= 1024){\n\t\t\tscaling_factor_width = 1152;\n\t\t\tscaling_factor_height = 648;\n\t\t }else if(current_screen_height >= 768){\n\t\t\tscaling_factor_width = 1024;\n\t\t\tscaling_factor_height = 576;\n\t\t}\n\t\tscaling_factor_height = scaling_factor_height * (1/imagedata_redux.length)\n\t\tscaling_factor_width = scaling_factor_width * (1/imagedata_redux.length)\n\n\n\t}, [imagedata_redux])\n\n\tconst addToCanvas = () => {\n\t\tvar color = \"#\" + ((1<<24)*Math.random() | 0).toString(16)\n\t\t\n\t\tif(currAnnotationData == null){\n\t\t\tsetCurrAnnotationData([])\n\t\t}\n\n\t\tvar annotation_type_txt = \"error\"\n\n\t\tif (annotationType === ANNOTATION_BBOX){\n\t\t\tannotation_type_txt = \"b\"\n\t\t\tvar new_bbox = new BoundingBox(50, 50, 50, 50, color, boxCount+'b', \"None\").generate_no_behavior()\n\t\t\tvar frame_dat = getFrameData(getCurrentFrame())\n\t\t\tframe_dat = Object.assign([], frame_dat)\n\t\t\tframe_dat.push(new_bbox)\n\t\t\tupdateFrameData(currframe_redux, frame_dat)\n\t\t\t//updateFrameData(currframe_redux, [new_bbox])\n\t\t}else if(annotationType === ANNOTATION_FRAME){\n\t\t\t//TODO Add annotation frame datapoint\n\t\t\tannotation_type_txt = \"f\"\n\t\t}\n\t\t\n\t\tvar saved_annot = getAnnotationData(getCurrentFrame())\n\t\tvar generated_annotation;\n\t\tif(inputType === INPUT_IMAGE){\n\t\t\tgenerated_annotation = create_annotation(boxCount+annotation_type_txt)\n\t\t}else{\n\t\t\tgenerated_annotation = create_annotation(boxCount+annotation_type_txt)\n\t\t}\n\t\tsaved_annot = Object.assign([], saved_annot)\n\t\tsaved_annot.push(generated_annotation)\n\t\tupdateAnnotationData(currframe_redux, saved_annot)\n\n\t\tsetBoxCount(boxCount + 1);\n\t}\n\n\n\tuseEffect(() =>{\n\t\tif(upload == true){\n\t\t\tsetCurrAnnotationData(getAnnotationData(currframe_redux))\n\t\t}\n\t}, [annot_redux])\n\n\tconst create_annotation = (id) => {\n\t\tvar columns = getColumnData()\n\t\tvar new_data = {}\n\t\tcolumns = columns['data']['columns']['columns']\n\t\tfor(var i = 0; i < columns.length; i++){\n\t\t\tvar curr_val = columns[i]\n\t\t\tnew_data[curr_val.accessor] = \"\"\n\t\t}\n\t\tif(inputType === INPUT_IMAGE){\n\t\t\tnew_data['dataType'] = \"image\"\n\t\t\tnew_data['fileName'] = \"temp\"//image_frames[currframe_redux]['name']\n\t\t}else{\n\t\t\tnew_data['dataType'] = \"video\"\n\t\t\tnew_data['fileName'] = \"frame_\" + currframe_redux\n\t\t}\n\t\tnew_data['id'] = id\n\t\treturn new_data\n\t}\n\n\tconst toggle_segmentation = (event) => {\n\t\tsegmentation_flag = !segmentation_flag\n\t}\n\n\tconst handleOldAnnotation = (event) => {\n\t\tvar promise = downloadOldAnnotation(event)\n\t\tpromise.then(function (result) {\n\t\t\tif(result != null){\n\t\t\t\tsetOldAnnotation(new ExtractingAnnotation(result, scaling_factor_width, scaling_factor_height));\n\t\t\t\tsetRes(result.vid_metadata.horizontal_res, result.vid_metadata.vertical_res)\n\t\t\t}else{\n\t\t\t\talert(\"Error in processing Annotation. Please check the file and try again.\")\n\t\t\t}\n\t\t})\n\t}\n\n\tuseEffect(() => {\n\t\t//TODO Find a more elegant solution. This is a temporay patch work.\n\t\tif(oldAnnotation == null){\n\t\t\treturn;\n\t\t}\n\t\tstore.dispatch({\n\t\t\ttype: \"frame_data/initOldAnnotation\",\n\t\t\tpayload: oldAnnotation.get_frame_data()\n\t\t});\n\t\tstore.dispatch({\n\t\t\ttype: \"annotation_data/initOldAnnotation\",\n\t\t\tpayload: oldAnnotation.get_annotation_data()\n\t\t});\n\t\tsetFrameRate(oldAnnotation.get_frame_rate())\n\t\tsetCurrAnnotationData(oldAnnotation.get_annotation_data()[0])\n\t\tsetBoxCount(oldAnnotation.find_highest_localid())\n\t}, [oldAnnotation]);\n\t\t\n\n\tuseEffect(() => { //This shold update the view upon column loading\n\t\tsetIsLoading(false)\n\t}, [column_redux])\n\n\n\tconst downloadOldAnnotation = (file) => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tvar reader = new FileReader();\n\t\t\treader.onload = function(e) {\n\t\t\t\tresolve((JSON.parse(e.target.result)));\n\t\t\t}\n\t\t\treader.readAsText(file.target.files[0])\n\t\t})\n\t}\n \n\tconst skip_frame_forward = e =>{\n\t\tvar frameVal = currframe_redux + skip_value\n\n\t\tif(frameVal >= metadata_redux['total_frames']){\n\t\t\tif(inputType === INPUT_IMAGE){\n\t\t\t\tsetCurrentFrame(metadata_redux['total_frames']-1)\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetCurrentFrame(metadata_redux['total_frames']-1)\n\t\t}else{\n\t\t\tif(inputType === INPUT_IMAGE){\n\t\t\t\tsetCurrentFrame(frameVal)\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetCurrentFrame(frameVal)\n\t\t}\n\t}\n\n\tconst skip_frame_backward = e => {\n\t\tvar frameVal = currframe_redux - skip_value\n\t\tif(frameVal < 0){\n\t\t\tif(inputType === INPUT_IMAGE){\n\t\t\t\tsetCurrentFrame(0)\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetCurrentFrame(0)\n\t\t}else{\n\t\t\tif(inputType === INPUT_IMAGE){\n\t\t\t\tsetCurrentFrame(frameVal)\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetCurrentFrame(frameVal)\n\t\t}\n\t}\n\n\tconst change_annotation_type = (event) => {\n\t\tsetAnnotationType(event)\n\t}\n\n\tconst onKeyPress = (event) =>{\n\t\t//Making sure input for textbox doesnt get counted as a mode change\n\t\tif(keyCheck === false){\n\t\t\treturn;\n\t\t}\n\t\tif(segmentation_flag === true){\n\t\t\talert(\"Please finish your current action!\")\n\t\t\treturn;\n\t\t}\n\t\tif (event.key === ANNOTATION_BBOX){\n\t\t\ttoast_text = \"Mode Switch: Bounding Box\"\n\t\t\tchangeSave(true)\n\t\t\tsetAnnotationType(ANNOTATION_BBOX)\n\t\t}else if (event.key === ANNOTATION_KEYPOINT){\n\t\t\ttoast_text = \"Mode Switch: Key Point\"\n\t\t\tchangeSave(true)\n\t\t\tsetAnnotationType(ANNOTATION_KEYPOINT)\n\t\t}else if(event.key === ANNOTATION_SEG) {\n\t\t\ttoast_text = \"Mode Switch: Segmentation\"\n\t\t\tchangeSave(true)\n\t\t\tsetAnnotationType(ANNOTATION_SEG)\n\t\t}else if(event.key === ANNOTATION_FRAME){\n\t\t\ttoast_text = \"Mode Switch: Behavior Annotation\"\n\t\t\tchangeSave(true)\n\t\t\tsetAnnotationType(ANNOTATION_FRAME)\n\t\t}else if (event.key === \"a\"){\n\t\t\tvar annotext = \"\"\n\t\t\tif(annotationType === ANNOTATION_BBOX){\n\t\t\t\tannotext = \"Bounding Box\"\n\t\t\t}else if(annotationType === ANNOTATION_FRAME){\n\t\t\t\tannotext = \"Behavior Data\"\n\t\t\t}else if (annotationType === ANNOTATION_KEYPOINT){\n\t\t\t\tannotext = \"Keypoint\"\n\t\t\t}else if (annotationType === ANNOTATION_SEG){\n\t\t\t\tannotext = \"Segmentation\"\n\t\t\t}\n\t\t\ttoast_text = \"Added Annotation - \" + annotext\n\t\t\tif(annotationType !== ANNOTATION_SEG){\n\t\t\t\tchangeSave(true)\n\t\t\t}\n\t\t\taddToCanvas()\n\t\t}else if (event.key === \"q\"){\n\t\t\tskip_frame_backward()\n\t\t}else if (event.key === \"e\"){\n\t\t\tskip_frame_forward()\n\t\t}else if(event.key === \"c\"){\n\t\t\t\n\t\t}\n\t} \n\n\tuseEffect(() => {\n\t\tdocument.addEventListener(\"keydown\", onKeyPress);\n\t\treturn () => document.removeEventListener(\"keydown\", onKeyPress);\n\t}, [onKeyPress]);\n\t\n\n\tconst handle_visual_toggle = () => {\n\t\tsetVisualToggle(Math.floor(Math.random() * 999999999999))\n\t}\n\n\tconst toggleKeyCheck = (toggle_val) => {\n\t\tconsole.log(\"Keycheck activated\")\n\t\tif(toggle_val === undefined){\n\t\t\tchangeKeyCheck(!keyCheck)\n\t\t}else{\n\t\t\tchangeKeyCheck(toggle_val)\n\t\t}\n\t}\n\n\tconst handleChangeAnnot = val => {\n\t\tsetCurrAnnotationData(val)\n\t}\n\n\tconst genFabricCanvas = () => {\n\t\tvar fcanvas = []\n\t\tfor(var i = 0; i < imagedata_redux.length; i++){\n\t\t\tlet canv = (\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t)\n\t\t\tfcanvas.push(canv)\n\t\t}\n\t\treturn(\n\t\t\t
\n\t\t\t{\n\t\t\t\tfcanvas.map((can, _) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tcan\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t}\n\t\t\t
\n\t\t)\n\t}\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t changeSave(false)} \n\t\t\t\tshow={save} delay={500} autohide\n\t\t\t\tstyle={{ position: 'absolute', top: '100', left: '100', zIndex: '100'}}\n\t\t\t>\n\t\t\t\t\n\t\t\t\t\t{toast_text}\n\t\t\t\t\n\t\t\t\n\t\t\t{\n\t\t\t\tupload === true && \n\t\t\t\t
\n\t\t\t\t\t{genFabricCanvas()}\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t}\n\t\t\t{\n\t\t\t\tupload === false &&\n\t\t\t\t
\n\t\t\t\t\t\"Video/Image upload not detected. Please upload.\"\n\t\t\t\t
\n\t\t\t}\n\t\t
\n\t);\n}\n","export const ANNOTATION_FRAME = \"1\"\nexport const ANNOTATION_BBOX = \"2\"\nexport const ANNOTATION_SEG = \"3\"\nexport const ANNOTATION_KEYPOINT = \"4\"\n","\nimport React, { useState } from \"react\";\nimport 'bootstrap/dist/css/bootstrap.min.css';\n\nimport Button from 'react-bootstrap/Button'\nimport Modal from 'react-bootstrap/Modal'\nimport Carousel from 'react-bootstrap/Carousel'\n\nimport MainUpload from './main_upload'\nimport { Container, Jumbotron, Card} from \"react-bootstrap\";\nimport Instructions from \"../Components/instructions\";\n\nimport selection_items from '../../static_data/selectionscreen_info.json'\n\n//\"logo\"\nfunction SelectionScreen(){\n const [show, setShow] = useState(false);\n const handleClose = () => setShow(false);\n const [upload, setUpload] = useState(false)\n const handleUpload = (event) => {\n setUpload(!upload)\n }\n\n const [multiview, setMultiview] = useState(false)\n\n if(upload){\n return ()\n }else{\n return (\n
\n \n \n Instructions\n \n \n \n \n \n \n
\n \n \n

AVAT

\n

Analysis tool to record data for livestock behavior and computer vision applications.

\n

\n \n

\n
\n
\n \n {\n selection_items.map((item, key) => {\n return(\n \n \n \n \n {item.altText}\n {item.description}\n \n \n \n )\n })\n }\n \n
\n
\n )\n }\n}\n\nexport default SelectionScreen;","/**\n * @author Pradeep Senthil (pradeepsen99@gmail.com)\n * @\n */\n\n import React, { useState } from \"react\"; \n import ReactDOM from 'react-dom'\n import './App.css';\n import ReactPlayer from 'react-player'\n import 'bootstrap/dist/css/bootstrap.min.css';\n \n import FrontEnd from './ui_elements/Pages/main_upload'\n import SelectionScreen from './ui_elements/Pages/selection_screen'\n \n //\n function App() {\n return (\n
\n \n
\n );\n }\n //\n //\n //
\n //\n //\n //
\n \n export default App;","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' },\n })\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then(registration => {\n registration.unregister();\n })\n .catch(error => {\n console.error(error.message);\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nimport { Provider } from 'react-redux'\nimport store from './store'\n\n/* ReactDOM.render(\n ,\n document.getElementById('root')\n);\n */\n\n//REDUX code\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n\n/**\n * IF NEED TO RE-ENABLE STRICT MODE THEN UNNCOMMENT AND ADD BACK\n * \n * \n \n ,\n */\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["fabric_types/fabric_boundingbox.js","annotations/bounding_box.js","processing/annotation-processing.js","static_data/behaviors.js","static_data/posture.js","static_data/confidence.js","static_data/columns.js","ui_elements/Components/instructions.js","reducer/frame_data.js","reducer/annotation_data.js","reducer/column_annot.js","reducer/current_frame.js","reducer/media_data.js","processing/actions.js","reducer/metadata.js","reducer/play_status.js","store.js","processing/exporting_annotation.js","ui_elements/Components/nav_bar.js","static_data/const.js","processing/download.js","ui_elements/Components/fabric_canvas.js","ui_elements/Components/annot_table.js","ui_elements/Components/change_table.js","ui_elements/Pages/main_upload.js","static_data/constants.js","ui_elements/Pages/selection_screen.js","App.js","serviceWorker.js","index.js"],"names":["fabric","require","util","createClass","Rect","type","initialize","options","this","callSuper","set","label","toObject","object","extend","get","_render","ctx","font","fillStyle","fillText","width","height","uniScaleTransform","BoundingBox","constructor","top","left","color","id","behavior","rectangle","hasRotatingPoint","fill","opacity","id_text","Text","toString","fontSize","generate_no_behavior","group","Group","borderColor","hasBorders","temp","local_id","toJSON","generate_mouse_no_behavior","canvas","isDown","origX","origY","on","o","pointer","getPointer","e","x","y","rect_temp","originX","originY","angle","transparentCorners","add","Math","abs","renderAll","off","ExtractingAnnotation","annotation_json","frame_data","annotation_data","metadata","get_frame_data","scale_annotations","get_frame_rate","error","get_annotation_data","find_highest_localid","localid","i","length","j","push","parseInt","replace","max","new_annotations","temp_data","curr_frame","random","new_bbox","points","curr_points","k","x_scaled","y_scaled","po","Polygon","strokeWidth","stroke","scaleX","scaleY","objectCaching","cornerColor","display_text","centerX","grouppo","perPixelTargetFind","lockMovementY","lockMovementX","selectable","behaviors","value","posture","confidence","columns","remove_table_index","dataField","text","headerStyle","editable","editor","Type","SELECT","headerFormatter","React","createElement","Button","className","onClick","formatter","cellContent","row","Instructions","frameDataSlice","createSlice","name","initialState","data","reducers","init","state","payload","initOldAnnotation","modifyFrame","currentFrame","middleware","getDefaultMiddleware","serializableCheck","actions","annotationDataSlice","console","log","undefined","columnDataSlice","currFrameDataSlice","changeFrame","mediaDataSlice","addMedia","media","stream_num","initFrameData","frame_count","store","dispatch","updateFrameData","frame_number","getFrameData","getState","JSON","parse","stringify","initAnnotationData","updateAnnotationData","getAnnotationData","initColumnData","column_dat","getCurrentFrame","current_frame","setCurrentFrame","frame_num","initMedia","num_streams","setMedia","setFrameRate","frame_rate","setMediaType","media_type","setTotalFrames","total_frames","setSkipValue","skip_val","skip_value","getMetaData","metadataSlice","horizontal_res","vertical_res","setRes","curr_framerate","playStatusSlice","play","togglePlay","configureStore","reducer","column_annot","media_data","play_status","devTools","process","ExportingAnnotation","VIDEO_METADATA","image_data","get_frame_json","standard_annot","Array","curr","frame_objects","_objects","raw_points","alert","get_frame_json_fullCanvas","get_frame_coco","CustomNavBar","props","show","setShow","useState","uploadShow","setUploadShow","videoFormat","setVideoFormat","setProcess","columnLoad","setColumnLoad","numStrems","setNumStreams","playText","setPlayText","handleClose","handleUploadClose","play_redux","useSelector","handleMediaUpload","event","target","files","downloadColumn","file","Promise","resolve","reject","reader","FileReader","onload","result","readAsText","useEffect","Modal","onHide","size","Header","closeButton","Title","Body","Footer","variant","backdrop","style","display","Form","Control","as","onChange","defaultValue","NavDropdown","Divider","toggleKeyCheck","onBlur","generateUploadButtons","uploadButtons","button_image","key","float","gridColumn","gridRow","File","multiple","accept","custom","button_video","map","but","_","disabled","disable_buttons","then","handleOldAnnotation","Navbar","sticky","bg","Brand","href","Nav","title","Item","handleDownloadJSON","converted_annot","video_width","video_height","async","json","blob","Blob","URL","createObjectURL","link","document","download","fileName","body","appendChild","click","removeChild","downloadFileJSON","NavLink","handleShow","handle_link_open","handleUploadShow","Dropdown","ButtonGroup","display_frame_num","Toggle","split","Menu","skip_frame_backward","skip_frame_forward","drop","addToCanvas","change_annotation_type","canvasBackgroundUpdate","currFrameData","inputType","image_url","scaling_factor_width","scaling_factor_height","fabricCanvas","remove_obj","arguments","img","Image","clear","enlivenObjects","enlivenedObjects","forEach","obj","index","f_img","setBackgroundImage","src","remove","getObjects","FabricRender","setFabricCanvas","currindex","setCurrindex","upload","setUpload","frameToUpdate","setFrameToUpdate","metadata_redux","frame_redux","image_data_store","currFrame","currframe_redux","save_data","reason","temp_fabricCanvas","Canvas","uniformScaling","includeDefaultValues","prototype","call","toDataURL","opt","delta","deltaY","zoom","getZoom","zoomToPoint","offsetX","offsetY","preventDefault","stopPropagation","objDrag","evt","altKey","isDragging","selection","lastPosX","clientX","lastPosY","clientY","vpt","viewportTransform","requestRenderAll","setViewportTransform","ReactDOM","findDOMNode","canvas_elem","getElementsByTagName","backgroundColor","video","currentTime","duration","requestAnimFrame","renderLoop","pause","ceil","source","onloadedmetadata","oncanplaythrough","new_vid","videoWidth","videoHeight","position","AnnotTable","_ref","select_data","change_annot","getTableProps","getTableBodyProps","headerGroups","rows","prepareRow","useTable","Object","assign","border","headerGroup","getHeaderGroupProps","headers","column","getHeaderProps","background","fontWeight","render","global_id","elem","curr_idx","row_vals","curr_elem","check_keys","data-type","data-curr","change_row","beh","delete_row","genSelection","original","curr_data","dataset","annot_delte","splice","curr_img_data","objects","obj_keys","keys","AnnotationTable","col","useMemo","accessor","Tabs","defaultActiveKey","Tab","eventKey","handleChangeAnnot","current_screen_height","window","screen","toast_text","segmentation_flag","MainUpload","visualToggle","setVisualToggle","annotationType","setAnnotationType","boxCount","setBoxCount","oldAnnotation","setOldAnnotation","save","changeSave","keyCheck","changeKeyCheck","isLoading","setIsLoading","currAnnotationData","setCurrAnnotationData","annot_redux","column_redux","imagedata_redux","annot","url","revokeObjectURL","annotation_type_txt","frame_dat","generated_annotation","saved_annot","create_annotation","new_data","downloadOldAnnotation","frameVal","onKeyPress","annotext","addEventListener","removeEventListener","toggle_val","vid_metadata","ANNOTATION_VIDEO_NAME","handle_visual_toggle","floor","Toast","onClose","delay","autohide","zIndex","genFabricCanvas","fcanvas","canv","can","change_annotation_data","val","default_column","SelectionScreen","handleUpload","multiview","setMultiview","Jumbotron","Container","Carousel","controls","fade","selection_items","item","interval","slide_time","Card","Img","altText","description","App","Boolean","location","hostname","match","Provider","getElementById","navigator","serviceWorker","ready","registration","unregister","catch","message"],"mappings":"y0CAAA,MAAMA,EAASC,EAAQ,IAAUD,OAEfA,EAAOE,KAAKC,YAAYH,EAAOI,KAAM,CACnDC,KAAM,cACNC,WAAY,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df,WACE,OACEza,IAAAC,cAAA,WACED,IAAAC,cAACuZ,GAAe,QCNHkB,QACW,cAA7B1E,OAAO2E,SAASC,UAEe,UAA7B5E,OAAO2E,SAASC,UAEhB5E,OAAO2E,SAASC,SAASC,MACvB,2DCFNpJ,IAASuC,OACLhU,IAAAC,cAAC6a,KAAQ,CAACxY,MAAOA,IACftC,IAAAC,cAACwa,GAAG,OAEN1O,SAASgP,eAAe,SD+GtB,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrBxQ,KAAKyQ,IACJA,EAAaC,eAEdC,MAAMve,IACL4E,QAAQ5E,MAAMA,EAAMwe,Y","file":"static/js/main.1e2a862b.chunk.js","sourcesContent":["const fabric = require(\"fabric\").fabric;\n\nvar boundingbox = fabric.util.createClass(fabric.Rect, {\n type: 'boundingbox',\n initialize: function(options) {\n options || (options = { });\n\n this.callSuper('initialize', options);\n this.set('label', options.label || '');\n },\n\n toObject: function() {\n return fabric.util.object.extend(this.callSuper('toObject'), {\n label: this.get('label')\n });\n },\n\n _render: function(ctx) {\n this.callSuper('_render', ctx);\n\n ctx.font = '10px Helvetica';\n ctx.fillStyle = '#333';\n /* scaleX = this.width / (this.width * this.scaleX),\n scaleY = this.height / (this.height * this.scaleY); */\n ctx.fillText(this.label, (-this.width/2), (-this.height/2 + 20));\n ctx.uniScaleTransform = false;\n }\n});\n \nexport {boundingbox};","import { boundingbox } from '../fabric_types/fabric_boundingbox'\nconst fabric = require(\"fabric\").fabric;\n\nclass BoundingBox {\n constructor(top, left, width, height, color, id, behavior) {\n this.top = top;\n this.left = left;\n this.id = id;\n this.behavior = behavior;\n this.color = color;\n this.width = width;\n this.height = height;\n }\n\n rectangle(){\n return new fabric.Rect({\n hasRotatingPoint: false,\n height: this.height,\n width: this.width,\n fill: this.color,\n opacity: '.4',\n top: this.top,\n left: this.left,\n });\n } \n\n //TODO Add text scaling\n id_text(){\n return new fabric.Text(this.id.toString(), {\n fontSize: 20,\n top: this.top,\n left: this.left,\n uniScaleTransform: false,\n });\n }\n\n generate_no_behavior(){\n var group = new fabric.Group([this.rectangle(), this.id_text()],{\n borderColor: '#000000',\n hasBorders: true,\n uniScaleTransform: true\n });\n /* var box = new boundingbox({\n hasRotatingPoint: false,\n height: this.height,\n width: this.width,\n fill: this.color,\n opacity: '.4',\n top: this.top,\n left: this.left,\n label: this.id.toString()\n }) */\n\n function onChange(obj) {\n var text_box = obj.target.item(1),\n group = obj.target,\n scaleX = group.width / (group.width * group.scaleX),\n scaleY = group.height / (group.height * group.scaleY);\n text_box.set('scaleX', scaleX);\n text_box.set('scaleY', scaleY);\n }\n /* canvas.on({\n 'object:scaling': onChange\n }) */\n\n var temp = this.id \n group.local_id = temp\n //canvas.add(group)\n //console.log(group.toJSON())\n return group.toJSON()\n }\n\n generate_mouse_no_behavior(canvas){\n var group, isDown, origX, origY;\n\n var temp_id = new fabric.Text(this.id.toString(), {\n fontSize: 20,\n top: this.top,\n left: this.left,\n uniScaleTransform: false,\n });\n\n canvas.on('mouse:down', function(o){\n isDown = true;\n var pointer = canvas.getPointer(o.e);\n origX = pointer.x;\n origY = pointer.y;\n var pointer = canvas.getPointer(o.e);\n var rect_temp = new fabric.Rect({\n left: origX,\n top: origY,\n originX: 'left',\n originY: 'top',\n width: pointer.x-origX,\n height: pointer.y-origY,\n angle: 0,\n fill: 'rgba(255,0,0,0.5)',\n transparentCorners: false,\n uniScaleTransform: true\n });\n group = rect_temp\n\n\n canvas.add(group)\n });\n \n canvas.on('mouse:move', function(o){\n if (!isDown) return;\n var pointer = canvas.getPointer(o.e);\n \n if(origX>pointer.x){\n group.set({ left: Math.abs(pointer.x) });\n }\n if(origY>pointer.y){\n group.set({ top: Math.abs(pointer.y) });\n }\n \n group.set({ width: Math.abs(origX - pointer.x) });\n group.set({ height: Math.abs(origY - pointer.y) });\n \n \n canvas.renderAll();\n });\n \n canvas.on('mouse:up', function(o){\n isDown = false;\n canvas.off('mouse:down')\n canvas.off('mouse:up')\n });\n }\n\n}\n\nexport {BoundingBox}","import {BoundingBox} from '../annotations/bounding_box'\nconst fabric = require(\"fabric\").fabric;\nconst $ = require(\"jquery\")\n\nexport default class ExtractingAnnotation{\n constructor(annotation_json, width, height){\n this.frame_data = annotation_json['annotations']\n this.annotation_data = annotation_json['behavior_data']\n this.width = width\n this.height = height\n this.metadata = annotation_json['vid_metadata']\n }\n\n get_frame_data(){\n return this.scale_annotations()\n }\n\n get_frame_rate(){\n try{\n return this.metadata['frame_rate']\n }catch (error){\n return 1\n }\n }\n \n get_annotation_data(){\n return this.annotation_data;\n }\n\n find_highest_localid(){\n var localid = []\n for(var i = 0; i < this.annotation_data.length; i++){\n for(var j = 0; j < this.annotation_data[i].length; j++){\n localid.push(parseInt(this.annotation_data[i][j]['id'].replace(/\\D/g, \"\")))\n }\n }\n return Math.max(...localid)+1\n }\n\n scale_annotations(){\n var new_annotations = []\n for(var i = 0; i < this.frame_data.length; i++){\n var temp_data = []\n var curr_frame = this.frame_data[i]\n if(curr_frame == null){\n new_annotations.push([])\n continue;\n }\n for(var j = 0; j < curr_frame.length; j++){\n if(curr_frame[j]['type'] === \"bounding_box\"){\n var x = (parseInt(curr_frame[j]['x']) / parseInt(this.metadata['horizontal_res']) * this.width) \n var y = (curr_frame[j]['y'] / this.metadata['vertical_res'] * this.height)\n var width = ((curr_frame[j]['width']) / this.metadata['horizontal_res'] * this.width)\n var height = ((curr_frame[j]['height']) / this.metadata['vertical_res'] * this.height)\n\n var color = \"#\" + ((1<<24)*Math.random() | 0).toString(16)\n var new_bbox = new BoundingBox(y, x, width, height, color, curr_frame[j]['local_id'], \"None\").generate_no_behavior(this)\n //this.add(new_bbox)\n new_bbox.local_id = curr_frame[j]['local_id']\n temp_data.push(new_bbox)\n }else if(curr_frame[j]['type'] === \"segmentation\"){\n var points = []\n var curr_points = curr_frame[j]['points']\n for(var k = 0; k < curr_points.length; k++){\n var x_scaled = (parseInt(curr_points[k]['x']) / parseInt(this.metadata['horizontal_res']) * this.width)\n var y_scaled = (curr_points[k]['y'] / this.metadata['vertical_res'] * this.height)\n points.push({x: x_scaled, y: y_scaled})\n }\n var po = new fabric.Polygon(points, {\n strokeWidth: 1,\n stroke: 'green',\n opacity: .5,\n scaleX: 1,\n scaleY: 1,\n objectCaching: false,\n transparentCorners: false,\n cornerColor: 'blue',\n originX: 'center',\n originY: 'center'\n });\n var display_text = new fabric.Text(curr_frame[j]['local_id'], {\n fontSize: 20,\n centerX: \"center\",\n top: points[0].y,\n left: points[0].x, \n uniScaleTransform: false,\n fill: \"white\",\n })\n var grouppo = new fabric.Group([po, display_text], {perPixelTargetFind: true})\n grouppo.lockMovementY = true;\n grouppo.lockMovementX = true;\n grouppo.selectable = false;\n grouppo.local_id = curr_frame[j]['local_id']\n //this.add(grouppo)\n temp_data.push(grouppo)\n }\n }\n new_annotations.push(temp_data)\n }\n return new_annotations\n }\n}\n\n//This is the parser for the Multi-Camera pig tracking output JSON code. \n/*\nclass MCPT_Processing {\n constructor(annotation_json){\n this.objects = annotation_json['objects']\n }\n\n getObjects_MCPT() {\n return this.objects\n }\n\n getObjectById_MCPT(id) {\n return this.objects[id]\n }\n \n getObjectByIdFrame(id, frame_num){\n return this.objects[id][frame_num]\n }\n\n getAllObjectByFrame_MCPT(frame_num){\n var i;\n var objects_frame = []\n for (i = 0; i < this.objects.length; i++){\n var curr_obj = this.objects[i]\n if(curr_obj['frames'][curr_obj['frames'].length-1]['frameNumber'] < frame_num){\n continue;\n }\n var curr_obj_frames = curr_obj['frames'];\n for (var j = 0; j < curr_obj_frames.length; j++){\n if(curr_obj_frames[j]['frameNumber'] === frame_num){\n objects_frame.push(curr_obj_frames[j]);\n break;\n }\n }\n }\n return objects_frame;\n }\n}*/","const behaviors = [{\n value: 'Feeding',\n label: 'Feeding'\n},{\n value: 'Drinking',\n label: 'Drinking'\n},{\n value: 'Exploratory',\n label: 'Exploratory'\n},{\n value: 'Social',\n label: 'Social'\n},{\n value: 'Locomotion',\n label: 'Locomotion'\n},{\n value: 'Proximity',\n label: 'Proximity'\n},{\n value: 'Others',\n label: 'Others'\n}]\n\nexport {behaviors};\n","const posture = [{\n value: 'Lying',\n label: 'Lying'\n},{\n value: 'Sitting',\n label: 'Sitting'\n},{\n value: 'Kneeling',\n label: 'Kneeling'\n},{\n value: 'Standing',\n label: 'Standing'\n}]\n\n export {posture}","const confidence = [{\n value: 'No occlusion',\n label: 'No occlusion'\n },{\n value: 'Minor occlusion',\n label: 'Minor occlusion'\n },{\n value: 'Split occlusion',\n label: 'Split occlusion'\n },{\n value: 'End occlusion',\n label: 'End occlusion'\n },{\n value: 'Critical occlusion',\n label: 'Critical occlusion'\n }\n]\nexport {confidence};\n","import React from \"react\"; \nimport { Type } from 'react-bootstrap-table2-editor';\nimport {behaviors} from './behaviors'\nimport {posture} from './posture'\nimport {status} from './status'\nimport {confidence} from './confidence'\nimport Button from 'react-bootstrap/Button'\n\nconst columns = (remove_table_index) => [{\n dataField: \"id\",\n text: \"ID\",\n headerStyle: () => { return { width: \"40px\", left: 0 }; },\n editable: false,\n},{\n dataField: \"global_id\",\n text: \"Glo\",\n headerStyle: () => { return { width: \"70px\", left: 0}; }\n},{\n dataField: \"posture\",\n text: \"Posture\",\n editor: {\n type: Type.SELECT,\n options: posture,\n }\n},\n{\n dataField: \"behavior\",\n text: \"Behavior\",\n editor: {\n type: Type.SELECT,\n options: behaviors,\n }\n},{\n dataField: \"confidence\",\n text: \"Confidence\",\n editor: {\n type: Type.SELECT,\n options: confidence,\n }\n},{\n dataField: \"remove\",\n text: \"Del\",\n editable: false,\n headerStyle: () => { return { width: \"50px\", left: 0}; },\n headerFormatter: () => {return (\n
\n Del\n remove_table_index()}\n label=\"Del\"\n >\n \n
\n );},\n formatter: (cellContent, row) => {\n return (\n
\n remove_table_index(row.id)}\n label=\"Del\"\n >\n \n
\n );\n },\n}\n]\nexport {columns}\n \n","import React from \"react\"; \n\nexport default function Instructions(){\n return (\n
\n

Keybinds:

\n\n There are preset keybinds setup to make it easier to use the tool without having to click around. If done properly a combination of mouse and keyboard actions speed up the annotation process. \n



\n * 1 : Mode Switch: Behavior

\n * 2 : Mode Switch: Bounding Box

\n * 3 : Mode Switch: Segmentation (Currently Disabled)

\n * a : Add annotation

\n * e : Skip forward frame(s)

\n * q : Skip backward frame(s)

\n * w : Pause/Play

\n\n



\n

Uploading Video:

\n\n Ensure that you know the framerate of the video chosen to be annotated. These values should be entered into the settings tab into their \"frame rate\" fields. \n



\n Click on the right side browse button. All other buttons on the screen shuold be disabled until the video has been uploaded. Currenntly ```.mp4``` format is the best choice and tested for. Other file types such as .avi are supported but might have unintended bugs.\n

\n Please note that videos SHOULD be in 16:9 aspect ratio for best results. Extraneous behavior may occur if resolution is different.\n



\n\n

Uploading Image:

\n Select all of the image files needed for the various inputs. To select a group of images, they should be in the same folder.\n

\n Please note that images SHOULD be in 16:9 aspect ratio for best results. Extraneous behavior may occur if resolution is different.\n



\n

Annotations

\n

\n There are currently two kinds of annotations. \n



\n

Behavior Annotation:

\n\n This is for having annotations that do not have any visual attribute attached to it. This annotation is also attached by default when the bounding box or segmentation annotation is created. \n\n



\n

Bounding Box:

\n\n This forms a square around the desired object. There should be small squares at the edges of the bounding box which can be used to resize the box. The number on the top left of the box is used to identify the placement of the box in the table to the right.\n



\n
\n )\n}","import {createSlice} from '@reduxjs/toolkit'\n\nconst initialState = {data: []}\n\nconst frameDataSlice = createSlice({\n name: 'frame_data',\n initialState,\n reducers:{\n init(state, payload){\n var data = [];\n for(var i = 0; i < payload.payload; i++){\n data.push([]);\n }\n state.data = data;\n },\n initOldAnnotation(state, payload){\n state.data = payload.payload\n },\n modifyFrame(state, payload){\n var temp = state.data\n temp[payload.payload.currentFrame] = payload.payload.data\n state.data = temp\n },\n middleware: (getDefaultMiddleware) => getDefaultMiddleware({\n serializableCheck: false\n })\n }\n})\n\nexport const {init, modifyFrame} = frameDataSlice.actions\nexport default frameDataSlice.reducer\n","import {createSlice} from '@reduxjs/toolkit'\n\nconst initialState = {data: []}\n\nconst annotationDataSlice = createSlice({\n name: 'annotation_data',\n initialState,\n reducers:{\n init(state, payload){\n console.log(payload.payload)\n var data = [];\n for(var i = 0; i < payload.payload; i++){\n data.push([]);\n }\n state.data = data;\n },\n initOldAnnotation(state, payload){\n state.data = payload.payload\n },\n modifyFrame(state, payload){\n var temp = state.data\n temp[payload.payload.currentFrame] = payload.payload.data\n state.data = temp\n },\n middleware: (getDefaultMiddleware) => getDefaultMiddleware({\n serializableCheck: false\n })\n }\n})\n\nexport const {init, modifyFrame} = annotationDataSlice.actions\nexport default annotationDataSlice.reducer","import {createSlice} from '@reduxjs/toolkit'\n\nconst initialState = {data: undefined}\n\nconst columnDataSlice = createSlice({\n name: 'column_annot',\n initialState,\n reducers:{\n init(state, payload){\n console.log(payload.payload.data)\n state.data = payload.payload.data\n },\n middleware: (getDefaultMiddleware) => getDefaultMiddleware({\n serializableCheck: false\n })\n }\n})\n\nexport const {init} = columnDataSlice.actions\nexport default columnDataSlice.reducer","import {createSlice} from '@reduxjs/toolkit'\n\nconst initialState = {data: undefined}\n\nconst currFrameDataSlice = createSlice({\n name: 'current_frame',\n initialState,\n reducers:{\n init(state, payload){\n console.log(payload.payload.data)\n state.data = payload.payload.data\n },\n changeFrame(state, payload){\n state.data = payload.payload.data\n },\n middleware: (getDefaultMiddleware) => getDefaultMiddleware({\n serializableCheck: false\n })\n }\n})\n\nexport const {init} = currFrameDataSlice.actions\nexport default currFrameDataSlice.reducer","import {createSlice} from '@reduxjs/toolkit'\n\nconst initialState = {data: []}\n\nconst mediaDataSlice = createSlice({\n name: 'media_data',\n initialState,\nreducers:{\n init(state, payload){\n var data = [];\n for(var i = 0; i < payload.payload; i++){\n data.push([]);\n }\n state.data = data;\n },\n addMedia(state, payload){\n var temp = state.data\n var media = payload.payload.media\n temp[payload.payload.stream_num] = media\n state.data = temp\n },\n middleware: (getDefaultMiddleware) => getDefaultMiddleware({\n serializableCheck: false\n })\n }\n})\n\nexport const {init, modifyFrame} = mediaDataSlice.actions\nexport default mediaDataSlice.reducer","import store from '../store'\n\n/*\nAction functions for frame_data\n*/\nfunction initFrameData(frame_count){\n\tstore.dispatch({\n\t\ttype: \"frame_data/init\",\n\t\tpayload: frame_count\n\t})\n}\nfunction updateFrameData(frame_number, data){\n\tstore.dispatch({\n\t\ttype: \"frame_data/modifyFrame\",\n\t\tpayload: {currentFrame: frame_number, data: data}\n\t})\n}\nfunction getFrameData(frame_number){\n\tconsole.log(store.getState())\n\treturn JSON.parse(JSON.stringify(store.getState().frame_data.data[frame_number]))\n} \n\n/*\nAction functions for annotation_data\n*/\nfunction initAnnotationData(frame_count){\n store.dispatch({\n\t\ttype: \"annotation_data/init\",\n\t\tpayload: frame_count\n\t})\n}\nfunction updateAnnotationData(frame_number, data){\n store.dispatch({\n\t\ttype: \"annotation_data/modifyFrame\",\n\t\tpayload: {currentFrame: frame_number, data: data}\n\t})\n}\nfunction getAnnotationData(frame_number){\n return JSON.parse(JSON.stringify(store.getState().annotation_data.data[frame_number]))\n}\n\n/*\nAction functions for column uploading\n*/\nfunction initColumnData(column_dat){\n\tstore.dispatch({\n\t\ttype: \"column_annot/init\",\n\t\tpayload: {data: column_dat}\n\t})\n}\n\nfunction getColumnData(){\n\treturn JSON.parse(JSON.stringify(store.getState().column_annot))\n}\n\nfunction initCurrentFrame(frame_num){\n\tstore.dispatch({\n\t\ttype: \"current_frame/init\",\n\t\tpayload: {data: frame_num}\n\t})\n}\n\nfunction getCurrentFrame(){\n\treturn JSON.parse(JSON.stringify(store.getState().current_frame))['data']\n}\n\nfunction setCurrentFrame(frame_num){\n\tstore.dispatch({\n\t\ttype: \"current_frame/changeFrame\",\n\t\tpayload: {data: frame_num}\n\t})\n}\n\nfunction initMedia(num_streams){\n\tstore.dispatch({\n\t\ttype: \"media_data/init\",\n\t\tpayload: num_streams\n\t})\n}\n\nfunction setMedia(stream_num, media){\n\tstore.dispatch({\n\t\ttype: \"media_data/addMedia\",\n\t\tpayload: {stream_num: stream_num, media: media}\n\t})\n}\n\nfunction initMetadata(horizontal_res, vertical_res, frame_rate, media_type, total_frames){\n\tstore.dispatch({\n\t\ttype: \"metadata/init\",\n\t\tpayload: {horizontal_res: horizontal_res, vertical_res: vertical_res, frame_rate: frame_rate, media_type: media_type, total_frames: total_frames}\n\t})\n}\n\nfunction setRes(horizontal_res, vertical_res){\n\tstore.dispatch({\n\t\ttype: \"metadata/setRes\",\n\t\tpayload: {horizontal_res: horizontal_res, vertical_res: vertical_res}\n\t})\n}\n\nfunction setFrameRate(frame_rate){\n\tstore.dispatch({\n\t\ttype: \"metadata/setFrameRate\",\n\t\tpayload: {frame_rate: frame_rate}\n\t})\n}\n\nfunction setMediaType(media_type){\n\tstore.dispatch({\n\t\ttype: \"metadata/setMediaType\",\n\t\tpayload: {media_type: media_type}\n\t})\n}\n\nfunction setTotalFrames(total_frames){\n\tstore.dispatch({\n\t\ttype: \"metadata/setTotalFrames\",\n\t\tpayload: {total_frames: total_frames}\n\t})\n}\n\nfunction setSkipValue(skip_val){\n\tstore.dispatch({\n\t\ttype: \"metadata/setSkipValue\",\n\t\tpayload: {skip_value: skip_val}\n\t})\n}\n\nfunction getMetaData(){\n\treturn JSON.parse(JSON.stringify(store.getState().metadata))\n}\n\nfunction togglePlay(){\n\tstore.dispatch({\n\t\ttype: \"play_status/togglePlay\",\n\t\tpayload: {}\n\t})\n}\n\nfunction initPlay(){\n\tstore.dispatch({\n\t\ttype: \"play_status/init\",\n\t\tpayload: {}\n\t})\n}\n\nexport {initFrameData, \n\t\tupdateFrameData, \n\t\tgetFrameData, \n\t\tinitAnnotationData, \n\t\tupdateAnnotationData, \n\t\tgetAnnotationData, \n\t\tinitColumnData, \n\t\tgetColumnData,\n\t\tinitCurrentFrame,\n\t\tgetCurrentFrame,\n\t\tsetCurrentFrame,\n\t\tinitMedia,\n\t\tsetMedia, \n\t\tinitMetadata,\n\t\tsetRes, \n\t\tsetFrameRate,\n\t\tsetMediaType,\n\t\tsetTotalFrames,\n\t\tsetSkipValue,\n\t\tgetMetaData,\n\t\ttogglePlay,\n\t\tinitPlay\n\t}\n","import {createSlice} from '@reduxjs/toolkit'\nimport {initFrameData, updateFrameData, getFrameData, initAnnotationData, updateAnnotationData, getAnnotationData, initColumnData, setMedia, initMedia} from '../processing/actions'\n\n\nconst initialState = {horizontal_res: 0, vertical_res: 0, frame_rate: 1, media_type: \"in_video\", total_frames: 0, skip_value: 1}\n\nconst metadataSlice = createSlice({\n name: 'metadata',\n initialState,\n reducers:{\n init(state, payload){\n state.horizontal_res = payload.payload.horizontal_res\n state.vertical_res = payload.payload.vertical_res\n state.frame_rate = payload.payload.frame_rate\n state.media_type = payload.payload.media_type\n state.total_frames = payload.payload.total_frames\n },\n setRes(state, payload){\n state.horizontal_res = payload.payload.horizontal_res\n state.vertical_res = payload.payload.vertical_res\n },\n setFrameRate(state, payload){\n\t // When the frame rate is changed, we first calculate the current frame rate and then multiply the total frames by the ratio of the new frame rate to the old frame rate\n\t if (state.media_type != \"in_image\") { // only for videos\n\t\t var curr_framerate = JSON.parse(JSON.stringify(state))['frame_rate']\n\t\t state.total_frames = state.total_frames / curr_framerate\n\t\t state.total_frames = state.total_frames * payload.payload.frame_rate\n\t\t state.frame_rate = payload.payload.frame_rate\n\t }\n },\n setMediaType(state, payload){\n state.media_type = payload.payload.media_type\n },\n setTotalFrames(state, payload){\n state.total_frames = payload.payload.total_frames\n },\n setSkipValue(state, payload){\n state.skip_value = payload.payload.skip_value\n },\n middleware: (getDefaultMiddleware) => getDefaultMiddleware({\n serializableCheck: false\n })\n }\n})\n\nexport const {init, setRes, setFrameRate, setMediaType, setTotalFrames, setSkipValue} = metadataSlice.actions\nexport default metadataSlice.reducer\n","import {createSlice} from '@reduxjs/toolkit'\n\nconst initialState = {play: false}\n\nconst playStatusSlice = createSlice({\n name: 'play_status',\n initialState,\n reducers:{\n init(state, payload){\n state.play = false;\n },\n togglePlay(state, payload){\n state.play = !state.play\n },\n middleware: (getDefaultMiddleware) => getDefaultMiddleware({\n serializableCheck: false\n })\n }\n})\n\nexport const {init, togglePlay} = playStatusSlice.actions\nexport default playStatusSlice.reducer\n","import { configureStore } from '@reduxjs/toolkit'\nimport frameDataSlice from './reducer/frame_data'\nimport annotationDataSlice from './reducer/annotation_data'\nimport columnDataSlice from './reducer/column_annot'\nimport currFrameDataSlice from './reducer/current_frame'\nimport mediaDataSlice from './reducer/media_data'\nimport metadataSlice from './reducer/metadata'\nimport playStatusSlice from './reducer/play_status'\n\nexport default configureStore({\n reducer: {\n frame_data: frameDataSlice,\n annotation_data: annotationDataSlice,\n column_annot: columnDataSlice,\n current_frame: currFrameDataSlice,\n media_data: mediaDataSlice,\n metadata: metadataSlice,\n play_status: playStatusSlice,\n },\n devTools: process.env.NODE_ENV !== 'production',\n})\n","export default class ExportingAnnotation{\n constructor(annotation_data, width, height, VIDEO_METADATA, image_data){\n console.log(width)\n console.log(height)\n this.frame_data = annotation_data\n this.width = width\n this.height = height\n this.metadata = VIDEO_METADATA\n this.image_data = image_data\n }\n\n get_frame_json(){\n var standard_annot = new Array(this.frame_data.length)\n console.log(this.metadata)\n console.log(this.frame_data)\n for(var i = 0; i < this.frame_data.length; i++){\n var curr = []\n if(this.frame_data[i] == []){\n console.log(\"Exporting error\")\n continue;\n }\n var frame_objects = this.frame_data[i]\n if(frame_objects == undefined){\n console.log(\"Exporting error\")\n continue;\n }\n \n for(var j = 0; j < frame_objects.length; j++){\n try {\n console.log(frame_objects[j])\n if(frame_objects[j] == undefined || frame_objects[j]['type'] !== \"group\"){\n continue;\n }\n if (frame_objects[j]._objects == undefined){\n continue;\n }\n if(frame_objects[j]._objects[0]['type'] === \"rect\"){\n console.log(frame_objects[j])\n var x = (frame_objects[j]['left'] / this.width) * this.metadata['horizontal_res']\n var y = (frame_objects[j]['top'] / this.height) * this.metadata['vertical_res']\n var width = ((frame_objects[j]['width'] * frame_objects[j]['scaleX']) / this.width) * this.metadata['horizontal_res']\n var height = ((frame_objects[j]['height'] * frame_objects[j]['scaleY']) / this.height )* this.metadata['vertical_res']\n var local_id = frame_objects[j]._objects[1]['text']\n if(this.metadata.media_type == \"in_image\"){\n curr.push({\"type\": \"bounding_box\",\"x\": x, \"y\": y, \"width\": width, \"height\": height, \"local_id\": local_id,\"fileName:\": this.image_data[i]['name'], \"dataType\": \"image\"})\n }else{\n curr.push({\"type\": \"bounding_box\",\"x\": x, \"y\": y, \"width\": width, \"height\": height, \"local_id\": local_id, \"fileName:\": this.metadata['name'], \"dataType\": \"video\"})\n }\n //curr.push({\"type\": \"bounding_box\",\"x\": x, \"y\": y, \"width\": width, \"height\": height, \"local_id\": local_id})\n }else if (frame_objects[j]._objects[0]['type'] === \"polygon\"){\n var raw_points = frame_objects[j]._objects[0]['points']\n var points = []\n console.log(this.metadata)\n console.log(this.metadata['horizontal_res'])\n console.log(this.width)\n console.log(this.height)\n for(var k = 0; k < raw_points.length; k++){\n var x = (raw_points[k]['x'] / this.width) * this.metadata['horizontal_res']\n var y = (raw_points[k]['y'] / this.height) * this.metadata['vertical_res']\n points.push({\"x\": x, \"y\": y})\n }\n var local_id = frame_objects[j]._objects[1]['text']\n\n if(this.metadata.media_type == \"in_image\"){\n curr.push({\"type\": \"segmentation\", \"points\": points, \"local_id\": local_id, \"fileName:\": this.image_data[i]['name'], \"dataType\": \"image\"})\n }else{\n curr.push({\"type\": \"segmentation\", \"points\": points, \"local_id\": local_id, \"fileName:\": this.metadata['name'], \"dataType\": \"video\"})\n }\n //curr.push({\"type\": \"segmentation\", \"points\": points, \"local_id\": local_id})\n }else{\n alert(\"Error in exporting annotation. Please check the annotation and try again.\")\n }\n } catch (error) {\n console.log(error)\n }\n\n }\n\n standard_annot[i] = curr\n }\n return standard_annot\n }\n\n get_frame_json_fullCanvas(){\n var standard_annot = new Array(this.frame_data.length)\n console.log(this.metadata)\n for(var i = 0; i < this.frame_data.length; i++){\n var curr = []\n\n if(this.frame_data[i] == []){\n continue;\n }\n var frame_objects = this.frame_data[i]['objects']\n if(frame_objects == undefined){\n continue;\n }\n \n for(var j = 0; j < frame_objects.length; j++){\n console.log(frame_objects[j])\n if(frame_objects[j]['type'] !== \"group\"){\n continue;\n }\n if(frame_objects[j]['objects'][0]['type'] === \"rect\"){\n console.log(frame_objects[j])\n var x = (frame_objects[j]['left'] / this.width) * this.metadata['horizontal_res']\n var y = (frame_objects[j]['top'] / this.height) * this.metadata['vertical_res']\n var width = ((frame_objects[j]['width'] * frame_objects[j]['scaleX']) / this.width) * this.metadata['horizontal_res']\n var height = ((frame_objects[j]['height'] * frame_objects[j]['scaleY']) / this.height )* this.metadata['vertical_res']\n var local_id = frame_objects[j]['objects'][1]['text']\n if(this.image_data.length != 0){\n curr.push({\"type\": \"bounding_box\",\"x\": x, \"y\": y, \"width\": width, \"height\": height, \"local_id\": local_id,\"fileName:\": this.image_data[i]['name'], \"dataType\": \"image\"})\n }else{\n curr.push({\"type\": \"bounding_box\",\"x\": x, \"y\": y, \"width\": width, \"height\": height, \"local_id\": local_id, \"fileName:\": this.metadata['name'], \"dataType\": \"video\"})\n }\n //curr.push({\"type\": \"bounding_box\",\"x\": x, \"y\": y, \"width\": width, \"height\": height, \"local_id\": local_id})\n }else if (frame_objects[j]['objects'][0]['type'] === \"polygon\"){\n var raw_points = frame_objects[j]['objects'][0]['points']\n var points = []\n for(var k = 0; k < raw_points.length; k++){\n var x = (raw_points[k]['x'] / this.width) * this.metadata['horizontal_res']\n var y = (raw_points[k]['y'] / this.height) * this.metadata['vertical_res']\n points.push({\"x\": x, \"y\": y})\n }\n var local_id = frame_objects[j]['objects'][1]['text']\n\n if(this.image_data.length != 0){\n curr.push({\"type\": \"segmentation\", \"points\": points, \"local_id\": local_id, \"fileName:\": this.image_data[i]['name'], \"dataType\": \"image\"})\n }else{\n curr.push({\"type\": \"segmentation\", \"points\": points, \"local_id\": local_id, \"fileName:\": this.metadata['name'], \"dataType\": \"video\"})\n }\n //curr.push({\"type\": \"segmentation\", \"points\": points, \"local_id\": local_id})\n }\n\n }\n\n standard_annot[i] = curr\n }\n return standard_annot\n }\n\n get_frame_coco(){\n\n }\n}","import React, { useEffect } from 'react';\nimport { useState } from 'react';\nimport \"bootstrap/dist/css/bootstrap.min.css\";\n\nimport Navbar from 'react-bootstrap/Navbar'\nimport Nav from 'react-bootstrap/Nav'\nimport Button from 'react-bootstrap/Button'\nimport { NavDropdown, NavLink } from 'react-bootstrap';\nimport Form from 'react-bootstrap/Form'\nimport Dropdown from 'react-bootstrap/Dropdown'\nimport { ButtonGroup } from 'react-bootstrap';\nimport Modal from 'react-bootstrap/Modal'\n\nimport \"react-datepicker/dist/react-datepicker.css\";\n\nimport Instructions from './instructions';\nimport { downloadFileJSON} from '../../processing/download';\n\nimport ExportingAnnotation from '../../processing/exporting_annotation';\nimport ProcessVideo from './process_video';\nimport store from '../../store' \nimport {INPUT_IMAGE, INPUT_VIDEO} from '../../static_data/const'\nimport { useSelector } from \"react-redux\";\n\nimport {initFrameData, updateFrameData, getFrameData, initAnnotationData, updateAnnotationData, getAnnotationData, initColumnData, setMedia, initMedia, setFrameRate, setMediaType, setSkipValue, getMetaData, togglePlay} from '../../processing/actions'\n\ninitMedia(1)\nexport default function CustomNavBar(props){\n\tconst [show, setShow] = useState(false);\n\tconst [uploadShow, setUploadShow] = useState(true);\n\tconst [videoFormat, setVideoFormat] = useState(INPUT_VIDEO)\n\tconst [process, setProcess] = useState(false)\n\tconst [columnLoad, setColumnLoad] = useState(false)\n\tconst [numStrems, setNumStreams] = useState(1)\n\tconst [playText, setPlayText] = useState(false)\n\n\tconst handleClose = () => setShow(false);\n\tconst handleShow = () => setShow(true);\n\tconst handleUploadClose = () => {setUploadShow(false); setProcess(true)}\n\tconst handleUploadShow = () => {\n\t\tsetUploadShow(true)\n\t}\n\tconst play_redux = useSelector(state => state.play_status.play)\n\n\tconst handleDownloadJSON = () => {\n\t\tvar converted_annot = new ExportingAnnotation(store.getState().frame_data.data, props.video_width, props.video_height, getMetaData(), store.getState().media_data.data[0]).get_frame_json()\n\t\tconsole.log(converted_annot)\n\t\tdownloadFileJSON(converted_annot, getMetaData())\n\t}\n\tconst handleVideoFormat = (type) => {\n\t\t//TODO Make sure bug is resolved and simply have video format equal type\n\t\t//type = parseInt(type)\n\t\tif(type === INPUT_VIDEO){\n\t\t\tsetVideoFormat(INPUT_VIDEO)\n\t\t\tsetMediaType(INPUT_VIDEO)\n\t\t}else if (type === INPUT_IMAGE){\n\t\t\tsetVideoFormat(INPUT_IMAGE)\n\t\t\tsetMediaType(INPUT_IMAGE)\n\t\t}else {\n\t\t\talert(\"Wrong input detected - please report this bug.\")\n\t\t}\n\t}\n\n\tconst convertFileToURLBlob = (file) => {\n\t\treturn URL.createObjectURL(file)\t\n\t}\n\n\tconst handleMediaUpload = (event) => {\n\t\tif(videoFormat == INPUT_VIDEO){\n\t\t\tsetMedia(parseInt(event.target.id), event.target.files)\n\t\t}else{\n\t\t\tsetMedia(parseInt(event.target.id), event.target.files)\n\t\t}\n\t}\n\n\tconst handleColumnUpload = (event) => {\n\t\tvar promise = downloadColumn(event)\n\t\tpromise.then(function (result) {\n\t\t\tif(result['columns'] == undefined){\n\t\t\t\talert(\"Error in processing columns. Please check the file and try again.\")\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(result != null){\n\t\t\t\tsetColumnLoad(true);\n\t\t\t\tinitColumnData(result)\n\t\t\t}else{\n\t\t\t\talert(\"Error in processing columns. Please check the file and try again.\")\n\t\t\t\treturn;\n\t\t\t}\n\t\t})\n\t}\n\n\tconst downloadColumn = (file) => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tvar reader = new FileReader();\n\t\t\treader.onload = function(e) {\n\t\t\t\tresolve((JSON.parse(e.target.result)));\n\t\t\t}\n\t\t\treader.readAsText(file.target.files[0])\n\t\t})\n\t}\n\n\tconst handleStreamNumChange = (event) => {\n\t\tsetNumStreams(event.target.value)\n\t\tinitMedia(event.target.value)\n\t}\n\n\tconst generateUploadButtons = () => {\n\t\tvar uploadButtons = []\n\t\tfor(var i = 0; i < numStrems; i++){\n\t\t\tlet button_image = (\n\t\t\t\t
\n\t\t\t\t\t {handleMediaUpload(event)}} />\n\t\t\t\t\n\t\t\t)\n\t\t\tlet button_video = (\n\t\t\t\t
\n\t\t\t\t\t {handleMediaUpload(event)}} />\n\t\t\t\t\n\t\t\t)\n\t\t\tif (videoFormat === INPUT_IMAGE){\n\t\t\t\tuploadButtons.push(button_image)\n\t\t\t}else if (videoFormat === INPUT_VIDEO){\n\t\t\t\tuploadButtons.push(button_video)\n\t\t\t}\n\t\t}\n\t\treturn (\n\t\t\t
\n\t\t\t{\n\t\t\t\tuploadButtons.map((but, _) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tbut\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t}\n\t\t\t
\n\t\t)\n\t}\n\n\tconst handlePlaying = (event) => {\n\t\ttogglePlay()\n\t}\n\n\tuseEffect(() => {\n\t\tif (play_redux == false){\n\t\t\tsetPlayText(\"Play\")\n\t\t}else {\n\t\t\tsetPlayText(\"Pause\")\n\t\t}\n\t}, [play_redux])\n\n\treturn (\n\t\t
\n\t\t\n\t\t\t\n\t\t\tInstructions\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\tUpload\n\t\t\t\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t{/*onClick and onBlur events are for the sole purpose to stop the eventKeys from firing off*/}\n\t\t\t\t\t
\n\t\t\t\t\t\tMedia Format: \n\t\t\t\t\t\t{handleVideoFormat(event.target.value)}}\n\t\t\t\t\t\t\tdefaultValue={videoFormat}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\tStream Num: {props.toggleKeyCheck(false)}} onBlur={(event) => {props.toggleKeyCheck(true)}} onChange={handleStreamNumChange}>\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t{\n\t\t\t\t\t\tgenerateUploadButtons()\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tFrame Rate: {props.toggleKeyCheck(false)}} onBlur={(event) => {props.toggleKeyCheck(true)}} onChange={(event) => {setFrameRate(event.target.value);}}>\n\t\t\t\t\t\n\t\t\t\t\tSkip Value: {setSkipValue(event.target.value)}}>\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t
\n\t\t\n\t\t\t\tAVAT\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t{' '}\n\t\t\t\t\t{' '}\n\t\t\t\t\t\n\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tSkip Value: {setSkipValue(event.target.value)}}>\n\t\t\t\t\t\t\n\t\t\t\t\t{' '}\n\t\t\t\t\t\n\t\t\t\t\t{' '}\n\t\t\t\t\t{\n\t\t\t\t\t\tvideoFormat === INPUT_VIDEO && \n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t{' '}\n\t\t\t\t\t{' '}\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{props.change_annotation_type(\"1\")}}>Behavior Annotation\n\t\t\t\t\t\t\t{props.change_annotation_type(\"2\")}}>BoundingBox\n\t\t\t\t\t\t\t{props.change_annotation_type(\"3\")}}>Segmentation\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t{/*{' '}*/}\n\t\t\t\t
\n\t\t
\n\t\t
\n\t)\n}\n","let INPUT_IMAGE = \"in_image\"\nlet INPUT_VIDEO = \"in_video\"\n\nexport {INPUT_IMAGE, INPUT_VIDEO}","import store from '../store'\nimport {getFrameData, getAnnotationData} from './actions'\n\nexport async function downloadFileJSON (frame_data, VIDEO_METADATA) {\n var fileName = \"generated_annotations\";\n \n const json = JSON.stringify({\"vid_metadata\": VIDEO_METADATA, \"annotations\": frame_data, \"behavior_data\": store.getState().annotation_data.data})\n //var json = JSON.stringify(frame_data);\n var blob = new Blob([json],{type:'application/json'});\n var href = await URL.createObjectURL(blob);\n var link = document.createElement('a');\n link.href = href;\n link.download = fileName + \".json\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n}\n\n\n//Legacy code below - Can be refrenced later IF need for CSV is present. Currently broken.\nfunction convert_data_csv(data, columns){\n console.log(columns)\n var csv = new Array(data.length + 1)\n for(var i = 0; i < csv.length; i++){\n csv[i] = []\n }\n csv[0].push(\"frame_num\")\n for(var i = 0; i < columns.length; i++){\n csv[0].push(columns[i]['dataField'])\n }\n for(var i = 0; i < data.length; i++){\n for(var j = 0; j < data[i].length; j++){\n csv[i+1][j]=[];\n var obj = data[i][j]\n var vals = Object.keys((obj)).map(function (key) { return obj[key]; });\n csv[i+1][j] = i + \",\" + vals.join(\",\")\n }\n csv[i+1] = csv[i+1].join(\"\\n\")\n }\n csv = csv.join(\"\\n\")\n return csv\n}\n\nexport async function downloadFileCSV (ANNOTATION_VIDEO_NAME, ANNOTATOR_NAME, annotation_data, columns) {\n var fileName = \"generated_annotations\";\n if(ANNOTATION_VIDEO_NAME !== \"\" && ANNOTATOR_NAME !== \"\"){\n fileName = ANNOTATION_VIDEO_NAME.split('.').slice(0, -1).join('.') + \"_\" + ANNOTATOR_NAME\n }\n var csv = convert_data_csv(annotation_data, columns(\"\"))\n var blob = new Blob([csv],{type:'application/octet-stream'});\n var href = await URL.createObjectURL(blob);\n var link = document.createElement('a');\n link.href = href;\n link.download = fileName + \".csv\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n}","import React, { useEffect, useState } from \"react\"; \nimport ReactDOM from 'react-dom'\n\nimport store from '../../store' \nimport {initFrameData, updateFrameData, getFrameData, \n\t\tinitAnnotationData, updateAnnotationData, getAnnotationData, \n\t\tinitColumnData, getColumnData, \n\t\tinitCurrentFrame, getCurrentFrame, setCurrentFrame, setTotalFrames,} from '../../processing/actions'\nimport { useSelector } from \"react-redux\";\n\nimport {INPUT_IMAGE, INPUT_VIDEO} from '../../static_data/const'\nconst fabric = require(\"fabric\").fabric;\n\n\nconst canvasBackgroundUpdate = (currFrameData, inputType, image_url, scaling_factor_width, scaling_factor_height, fabricCanvas, remove_obj=true) => {\n\tif(inputType == INPUT_IMAGE){ //This is for when images are uploaded\n\t\tvar img = new Image()\n\t\timg.onload = function() {\n\t\t\tif (remove_obj){\n\t\t\t\tfabricCanvas.clear();\n\t\t\t}\n\t\t\tif(currFrameData != undefined){\n\t\t\t\tfabric.util.enlivenObjects(currFrameData, function (enlivenedObjects){\n\t\t\t\t\tenlivenedObjects.forEach(function (obj, index) {\n\t\t\t\t\t\tfabricCanvas.add(obj);\n\t\t\t\t\t});\n\t\t\t\t\tfabricCanvas.renderAll();\n\t\t\t\t})\n\t\t\t}\n\t\t\tvar f_img = new fabric.Image(img, {\n\t\t\t\tobjectCaching: false,\n\t\t\t\tscaleX: scaling_factor_width / img.width,\n\t\t\t\tscaleY: scaling_factor_height / img.height\n\t\t\t});\n\t\t\tfabricCanvas.setBackgroundImage(f_img);\n\t\t\n\t\t\tfabricCanvas.renderAll();\n\t\t};\n\t\timg.src = URL.createObjectURL(image_url)\n\t\treturn;\n\t}else{ //This is for videos\n\t\tif (remove_obj){\n\t\t\tfabricCanvas.remove(...fabricCanvas.getObjects());\n\t\t}\n\t\tif(currFrameData != undefined){\n\t\t\tfabric.util.enlivenObjects(currFrameData, function (enlivenedObjects){\n\t\t\t\tenlivenedObjects.forEach(function (obj, index) {\n\t\t\t\t\tfabricCanvas.add(obj);\n\t\t\t\t});\n\t\t\t\tfabricCanvas.renderAll();\n\t\t\t})\n\t\t}\n\t\tfabricCanvas.renderAll();\n\t}\n}\n\nexport default function FabricRender(props){\n\tconst [fabricCanvas, setFabricCanvas] = useState(null)\n\tconst [currindex, setCurrindex] = useState(0)\n\tconst [upload, setUpload] = useState(false)\n\tconst [frameToUpdate, setFrameToUpdate] = useState(0)\n\tconst metadata_redux = useSelector(state => state.metadata)\n\tconst frame_redux = useSelector(state => state.frame_data)\n\tconst image_data_store = useSelector(state => state.media_data)\n\tconst currFrame = useSelector(state => state.current_frame)\n\tconst currframe_redux = currFrame['data']\n\tconst play_redux = useSelector(state => state.play_status.play)\n\tconst image_data = image_data_store['data'][props.stream_num]\n\n\tconst save_data = (frame_number, reason) => {\n\t\tif(fabricCanvas){\n\t\t\tconsole.log('SAVING DATA FOR FRAME', frame_number, reason)\n\t\t\tupdateFrameData(frame_number, fabricCanvas.getObjects())\n\t\t}\n\t}\n\n\tuseEffect(() => {\n\t\tvar temp_fabricCanvas = (new fabric.Canvas('c', {\n\t\t\tuniScaleTransform: true,\n\t\t\tuniformScaling: false,\n\t\t\tincludeDefaultValues: false\n\t\t}));\n\n\t\tfabric.Image.prototype.toObject = (function(toObject) {\n\t\t\treturn function() {\n\t\t\t\treturn fabric.util.object.extend(toObject.call(this), {\n\t\t\t\t\tsrc: this.toDataURL()\n\t\t\t\t});\n\t\t\t};\n\t\t})(fabric.Image.prototype.toObject);\n\n\t\ttemp_fabricCanvas.on('mouse:wheel', function(opt) {\n\t\t\tvar delta = opt.e.deltaY;\n\t\t\tvar zoom = temp_fabricCanvas.getZoom();\n\t\t\tzoom *= 0.999 ** delta;\n\t\t\tif (zoom > 20) zoom = 20;\n\t\t\tif (zoom < 0.01) zoom = 0.01;\n\t\t\ttemp_fabricCanvas.zoomToPoint({ x: opt.e.offsetX, y: opt.e.offsetY }, zoom);\n\t\t\topt.e.preventDefault();\n\t\t\topt.e.stopPropagation();\n\t\t});\n\n\t\ttemp_fabricCanvas.on('object:modified', function (event) {\n\t\t\tthis.objDrag = true;\n updateFrameData(currframe_redux, temp_fabricCanvas.getObjects())\n\t\t});\n\n\t\ttemp_fabricCanvas.on('mouse:down', function(opt) {\n\t\t\tvar evt = opt.e;\n\t\t\tif (evt.altKey === true) {\n\t\t\t\tthis.isDragging = true;\n\t\t\t\tthis.selection = false;\n\t\t\t\tthis.lastPosX = evt.clientX;\n\t\t\t\tthis.lastPosY = evt.clientY;\n\t\t\t}\n\t\t});\n\t\ttemp_fabricCanvas.on('mouse:move', function(opt) {\n\t\t\tif (this.isDragging) {\n\t\t\t\tvar e = opt.e;\n\t\t\t\tvar vpt = this.viewportTransform;\n\t\t\t\tvpt[4] += e.clientX - this.lastPosX;\n\t\t\t\tvpt[5] += e.clientY - this.lastPosY;\n\t\t\t\tthis.requestRenderAll();\n\t\t\t\tthis.lastPosX = e.clientX;\n\t\t\t\tthis.lastPosY = e.clientY;\n\t\t\t}\n\t\t});\n\t\ttemp_fabricCanvas.on('mouse:up', function(opt) {\n if(this.objDrag){\n\t\t\t\tthis.objDrag = false;\n\t\t\t}\n\t\t\tthis.setViewportTransform(this.viewportTransform);\n\t\t\tthis.isDragging = false;\n\t\t\tthis.selection = true;\n\t\t});\n\n\t\tvar el = ReactDOM.findDOMNode(this);\n\t\tvar canvas_elem = document.getElementsByTagName('canvas')[props.stream_num*2]\n\t\ttemp_fabricCanvas.initialize(canvas_elem, {\n\t\t\theight: props.scaling_factor_height,\n\t\t \twidth: props.scaling_factor_width,\n\t\t \tbackgroundColor : null,\n\t\t});\n\n\t\tsetFabricCanvas(temp_fabricCanvas)\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif(fabricCanvas){\n\t\t\tsave_data(frameToUpdate, \"frame_change\")\n\t\t\tsetFrameToUpdate(currframe_redux) \n\t\t\tvar video = document.getElementsByTagName('video')[props.stream_num]\n\t\t\tif(upload == true){\n\t\t\t\tvideo.currentTime = (video.duration * ((currframe_redux+1)/metadata_redux['total_frames']))\t\t\t\n\t\t\t}\n\t\t\tif(metadata_redux['media_type'] == INPUT_VIDEO){\n\t\t\t\tcanvasBackgroundUpdate(getFrameData(currframe_redux), INPUT_VIDEO, image_data[0], props.scaling_factor_width, props.scaling_factor_height, fabricCanvas)\n\t\t\t}else if (metadata_redux['media_type'] == INPUT_IMAGE){\n\t\t\t\tcanvasBackgroundUpdate(getFrameData(currframe_redux), INPUT_IMAGE, image_data[currframe_redux], props.scaling_factor_width, props.scaling_factor_height, fabricCanvas)\n\t\t\t}\n\t\t}\n\t}, [currFrame])\n\n\tuseEffect(() => {\n\t\tif (upload==false){\n\t\t\treturn\n\t\t}\n\t\tvar video = document.getElementsByTagName('video')[props.stream_num]\n\t\tif(play_redux){\n\t\t\tsave_data(frameToUpdate, \"play\")\n\t\t\tvideo.play()\n\t\t\tfabric.util.requestAnimFrame(function renderLoop() {\n\t\t\t\tfabricCanvas.renderAll();\n\t\t\t \tfabric.util.requestAnimFrame(renderLoop);\n\t\t\t});\n\t\t}else{\n\t\t\tvideo.pause()\n\t\t\tlet frame_number = Math.ceil((video.currentTime / video.duration) * metadata_redux['total_frames'])\n\t\t\tconsole.log(\"FRAME NUMBER\", frame_number)\n\t\t\tsetCurrentFrame(frame_number)\n\t\t}\n\t}, [play_redux])\n\n\n\tuseEffect(() => {\n\t\t// We want to redraw when a annotation is added or removed. Unfortunately this also causes a redraw when the current frame is changed.\n\t\t// This is not ideal, but it is a good enough solution for now. This should NOT save the data.\n\n\t\tif(fabricCanvas){\n\t\t\tcanvasBackgroundUpdate(getFrameData(currframe_redux), metadata_redux['media_type'], image_data[currframe_redux], props.scaling_factor_width, props.scaling_factor_height, fabricCanvas)\n\t\t}\n\t}, [frame_redux])\n\n\t\n\tif(fabricCanvas != null && image_data != undefined && upload===false && play_redux===false){\n\t\tif(image_data.length > 0){\n\t\t\tif(metadata_redux['media_type'] == INPUT_VIDEO){\n\t\t\t\tvar video = document.getElementsByTagName('video')[props.stream_num]\n\t\t\t\tvar source = document.createElement('source');\n\t\t\t\tsource.src = URL.createObjectURL(image_data[0])\n\t\t\t\tsource.type = \"video/mp4\"\n\t\t\t\tvideo.appendChild(source)\n\t\t\t\tvideo.onloadedmetadata = function(){\n\t\t\t\t\tinitAnnotationData(parseInt(video.duration))\n\t\t\t\t\tinitFrameData(parseInt(video.duration))\n\t\t\t\t\tsetTotalFrames(parseInt(video.duration))\n\t\t\t\t\tvideo.currentTime=0\n\t\t\t\t}\n\t\t\t\tvideo.oncanplaythrough = function(){\n\t\t\t\t\tif(upload === false){\n\t\t\t\t\t\tvar new_vid = new fabric.Image(video, {\n\t\t\t\t\t\t\tobjectCaching: false,\n\t\t\t\t\t\t\tscaleX: props.scaling_factor_width / video.videoWidth,\n\t\t\t\t\t\t\tscaleY: props.scaling_factor_height / video.videoHeight\n\t\t\t\t\t\t})\n\t\t\t\t\t\tvideo.width = video.videoWidth\n\t\t\t\t\t\tvideo.height = video.videoHeight\n\t\t\t\t\t\tfabricCanvas.setBackgroundImage(new_vid);\n\t\t\t\t\t\tfabricCanvas.renderAll();\n\t\t\t\t\t}\n\t\t\t\t\tsetUpload(true)\n\t\t\t\t}\n\t\t\t}else if(metadata_redux['media_type'] == INPUT_IMAGE){\n\t\t\t\tcanvasBackgroundUpdate(getFrameData(currframe_redux), INPUT_IMAGE, image_data[currframe_redux], props.scaling_factor_width, props.scaling_factor_height, fabricCanvas)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn(\n\t\t
\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t)\n\t\t //}\n}\n","import React from 'react'\nimport {initFrameData, updateFrameData, getFrameData, initAnnotationData, updateAnnotationData, getAnnotationData} from '../../processing/actions'\n\nimport { useTable, usePagination } from 'react-table'\n\nexport default function AnnotTable({columns, data, select_data, current_frame, change_annot}){\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n } = useTable({\n columns,\n data,\n })\n if(!columns){\n return (\n
\n {\"No column upload detected.\"}\n
\n )\n }\n\n return(\n \n \n {headerGroups.map(headerGroup => (\n \n {headerGroup.headers.map(column => (\n \n ))}\n \n ))}\n \n \n {rows.map((row, i) => {\n prepareRow(row)\n const {id, global_id, posture, behavior, confidence} = row\n var selection = genSelection(row.original, select_data, columns, i, current_frame)\n return(selection)\n })}\n \n
{column.render('Header')}
\n )\n}\n\nconst change_row = (e) => {\n var curr_data = getAnnotationData(e.target.dataset.curr)\n if (curr_data.length === 0){\n alert(\"Row changing value failed - please report this bug.\")\n return;\n }\n curr_data[e.target.id][e.target.dataset.type] = e.target.value\n updateAnnotationData(parseInt(e.target.dataset.curr), curr_data)\n}\n\nconst delete_row = (e) => {\n var curr_data = getAnnotationData(e.target.dataset.curr)\n if (curr_data.length === 0){\n alert(\"Row deletion failed - please report this bug.\")\n return;\n }\n var annot_delte = curr_data[e.target.id]['id']\n console.log(annot_delte)\n curr_data.splice(e.target.id, 1)\n updateAnnotationData(parseInt(e.target.dataset.curr), curr_data)\n var curr_img_data = getFrameData(e.target.dataset.curr)\n for(var i = 0; i < curr_img_data.length; i++){\n if(curr_img_data[i].objects[1].text == annot_delte){\n curr_img_data.splice(i, 1)\n }\n }\n updateFrameData(parseInt(e.target.dataset.curr), curr_img_data)\n}\n\nfunction genSelection(elem, select_data, columns, curr_idx, current_frame){\n var row_vals = []\n console.log(current_frame)\n for(var i = 0; i < columns[0].columns.length; i++){\n var curr_elem = columns[0].columns[i]['accessor']\n if(!check_keys(select_data, curr_elem)){\n continue\n }\n let temp = (\n \n )\n row_vals.push(temp)\n }\n \n let combined_elems = (\n \n {elem.id}\n \n \n \n {\n row_vals.map((i, j) => {\n return({i})\n })\n }\n \n \n \n \n )\n return combined_elems\n}\n\nfunction check_keys(obj, key){\n let obj_keys = Object.keys(obj)\n for(var i = 0; i < obj_keys.length; i++){\n if(obj_keys[i] === key){\n return true\n }\n }\n return false\n}\n","import React from \"react\"; \nimport 'bootstrap/dist/css/bootstrap.min.css';\n\nimport BootstrapTable from 'react-bootstrap-table-next';\nimport cellEditFactory, { Type } from 'react-bootstrap-table2-editor';\nimport 'react-bootstrap-table-next/dist/react-bootstrap-table2.min.css';\nimport paginationFactory from 'react-bootstrap-table2-paginator';\n\nimport Tabs from 'react-bootstrap/Tabs'\nimport Tab from 'react-bootstrap/Tab'\nimport Button from 'react-bootstrap/Button'\nimport { FormControl } from \"react-bootstrap\";\n\nimport AnnotTable from './annot_table'\nimport SwapAnnotTable from \"./cumulative_annot_table\";\n\nimport store from '../../store'\n\nfunction getAnnotationTableCount() {\n var annotation_data = store.getState().annotation_data.data\n var data = []\n if (!annotation_data){\n return data\n }\n for(var i = 0; i < annotation_data.length; i++){\n if(annotation_data[i].length !== 0){\n var txt_id = \"\"\n var txt_global = \"\"\n for(var j = 0; j < annotation_data[i].length; j++){\n txt_id += (annotation_data[i][j]['id']) + ', '\n txt_global += (annotation_data[i][j]['global_id']) + ', '\n }\n data.push({frame_num: i, anno_count: annotation_data[i].length, local_ids: txt_id, global_ids: txt_global})\n }\n }\n return data\n}\n\n\nexport default function AnnotationTable(props){\n var annotation_data = (props.annotation_data)\n var columns = []\n var col = []\n var select_data = undefined\n if(store.getState().column_annot.data != undefined){\n col = store.getState().column_annot.data['columns']\n select_data = store.getState().column_annot.data['select_data']\n columns.push(col)//hookBypass(col)\n }\n const anno_col = React.useMemo(\n () => [\n {\n Header: 'Name',\n columns: [\n {\n Header: 'Frame',\n accessor: 'frame_num',\n },\n {\n Header: 'Count',\n accessor: 'anno_count',\n },\n {\n Header: 'Local ID',\n accessor: 'local_id',\n },\n {\n Header: 'Global ID',\n accessor: 'global_ids',\n },\n /*{\n Header: 'Swap',\n accessor: 'swap',\n }*/\n ],\n }\n ],\n []\n )\n\n //TODO Add in force option for user to upload some sort of config file to continue along to next steps.\n return (\n
\n {\n col.length != 0 &&\n \n \n \n \n\n \n } \n
\n \n )\n}\n/*\n \n \n \n*/\n/*\n\n
No recorded annotations or behaviors for this video.
}\n pagination={ paginationFactory() }\n />\n
\n*/","//Core imports\nimport React, { useEffect, useState } from \"react\";\nimport 'bootstrap/dist/css/bootstrap.min.css';\n\n//Constants\nimport {INPUT_IMAGE, INPUT_VIDEO} from '../../static_data/const'\n\n//UI Element imports\nimport Toast from 'react-bootstrap/Toast'\n\n//Processing\nimport ExtractingAnnotation from '../../processing/annotation-processing'\n\n//Annotations\nimport { BoundingBox } from '../../annotations/bounding_box'\n\n//Column information + data structure\nimport {columns} from '../../static_data/columns'\nimport {ANNOTATION_FRAME, ANNOTATION_BBOX, ANNOTATION_KEYPOINT, ANNOTATION_SEG} from '../../static_data/constants'\n\n//Components\nimport CustomNavBar from \"../Components/nav_bar\";\nimport FabricRender from \"../Components/fabric_canvas\";\nimport AnnotationTable from \"../Components/change_table\";\n\n\n//Redux\nimport store from '../../store' \nimport {initFrameData, updateFrameData, getFrameData, \n\t\tinitAnnotationData, updateAnnotationData, getAnnotationData, \n\t\tgetColumnData,\n\t\tinitCurrentFrame, getCurrentFrame, setCurrentFrame,\n\t\tinitMedia,\n\t\tinitMetadata, setRes, setFrameRate, setTotalFrames,\n initColumnData,\n\t\tinitPlay} from '../../processing/actions'\nimport { useSelector } from \"react-redux\";\n\n// Data imports\nimport default_column from '../../static_data/basic_column_config.json'\n\nconst fabric = require(\"fabric\").fabric;\n\n//TODO ADD DYNAMIC SOLUTION\nvar scaling_factor_width = 1920;\nvar scaling_factor_height = 1080;\n\n//var current_screen_width = window.screen.width;\nvar current_screen_height = window.screen.height;\n\nif(current_screen_height >= 1080){////Mappings are based off of https://en.wikipedia.org/wiki/List_of_common_resolutions make sure to use 1:1 and 16:9 aspect ratio\n scaling_factor_width = 1280;\n scaling_factor_height = 720;\n}else if(current_screen_height >= 1024){\n scaling_factor_width = 1152;\n scaling_factor_height = 648;\n}else if(current_screen_height >= 768){\n scaling_factor_width = 1024;\n scaling_factor_height = 576;\n}\n\nvar upload = false;\nvar disable_buttons = true;\nvar toast_text = \"\"\nvar ANNOTATION_VIDEO_NAME = \"\"\nvar VIDEO_METADATA = {}\nvar play_button_text = \"Play\"\nvar segmentation_flag = false;\n\n//TODO remove after fixing null exceptions\ninitAnnotationData(1)\ninitFrameData(1)\ninitCurrentFrame(0)\ninitMetadata(scaling_factor_width, scaling_factor_height, 1, INPUT_VIDEO, 1)\ninitPlay()\nconsole.log(default_column)\ninitColumnData(\n default_column\n)\n\n//Current frame counter\nexport default function MainUpload() {\n\tconst [visualToggle, setVisualToggle] = useState(0);\n\tconst [annotationType, setAnnotationType] = useState(\"1\")\n\tconst [boxCount, setBoxCount] = useState(0)\n\tconst [oldAnnotation, setOldAnnotation] = useState(null)\n\tconst [save, changeSave] = useState(false);\n\tconst [keyCheck, changeKeyCheck] = useState(true)\n\tconst [isLoading, setIsLoading] = useState(true)\n\n\t//New state vars\n\tconst [currAnnotationData, setCurrAnnotationData] = useState([])\n\n\tconst annot_redux = useSelector(state => state.annotation_data.data)\n\tconst column_redux = useSelector(state => state.column_annot.data)\n\tconst currframe_redux = useSelector(state => state.current_frame)['data']\n\tconst imagedata_redux = useSelector(state => state.media_data.data)\n\tconst metadata_redux = useSelector(state => state.metadata)\n\tvar inputType = metadata_redux['media_type']\n\tvar skip_value = parseInt(metadata_redux['skip_value'])\n\n\tuseEffect(() => {\n\t\tif(upload == true){\n\t\t\tvar annot = getAnnotationData(currframe_redux)\n\t\t\tsetCurrAnnotationData(annot)\n\t\t}\n\t}, [currframe_redux])\n\n\tuseEffect(()=>{\n\t\tif(annot_redux.length === 1){\n\t\t\tinitAnnotationData(metadata_redux.total_frames)\n\t\t\tinitFrameData(metadata_redux.total_frames)\n\t\t}\n\t}, [metadata_redux]);\n\n\tuseEffect(() => {\n\t\tif(imagedata_redux[0].length != 0){\n\t\t\tif(metadata_redux['media_type'] == INPUT_IMAGE){\n\t\t\t\tsetTotalFrames(imagedata_redux[0].length)\n\t\t\t\tupload = true\n\t\t\t\tdisable_buttons = false\n\t\t\t\tinitAnnotationData(imagedata_redux[0].length)\n\t\t\t\tinitFrameData(imagedata_redux[0].length)\n\t\t\t\tvar url = (imagedata_redux[0][0])\n\t\t\t\tvar img = new Image;\n\t\t\t\timg.onload = function() {\n\t\t\t\t\tVIDEO_METADATA = {\"horizontal_res\": img.width, \"vertical_res\": img.height}\n\t\t\t\t\tURL.revokeObjectURL(img.src)\n\t\t\t\t}\n\t\t\t\timg.src = url\n\t\t\t\tsetVisualToggle(10)\n\t\t\t}else if(metadata_redux['media_type'] == INPUT_VIDEO){\n\t\t\t\tupload = true\n\t\t\t\tdisable_buttons = false\n\t\t\t\tinitAnnotationData(imagedata_redux[0].length)\n\t\t\t\tinitFrameData(imagedata_redux[0].length)\n\t\t\t\tsetVisualToggle(10)\n\t\t\t}\n\t\t}\n\t\tscaling_factor_width = 1920;\n\t\tscaling_factor_height = 1080;\n\t\tif(current_screen_height >= 1080){////Mappings are based off of https://en.wikipedia.org/wiki/List_of_common_resolutions make sure to use 1:1 and 16:9 aspect ratio\n\t\t\tscaling_factor_width = 1280;\n\t\t\tscaling_factor_height = 720;\n\t\t }else if(current_screen_height >= 1024){\n\t\t\tscaling_factor_width = 1152;\n\t\t\tscaling_factor_height = 648;\n\t\t }else if(current_screen_height >= 768){\n\t\t\tscaling_factor_width = 1024;\n\t\t\tscaling_factor_height = 576;\n\t\t}\n\t\tscaling_factor_height = scaling_factor_height * (1/imagedata_redux.length)\n\t\tscaling_factor_width = scaling_factor_width * (1/imagedata_redux.length)\n\n\n\t}, [imagedata_redux])\n\n\tconst addToCanvas = () => {\n\t\tvar color = \"#\" + ((1<<24)*Math.random() | 0).toString(16)\n\t\t\n\t\tif(currAnnotationData == null){\n\t\t\tsetCurrAnnotationData([])\n\t\t}\n\n\t\tvar annotation_type_txt = \"error\"\n\n\t\tif (annotationType === ANNOTATION_BBOX){\n\t\t\tannotation_type_txt = \"b\"\n\t\t\tvar new_bbox = new BoundingBox(50, 50, 50, 50, color, boxCount+'b', \"None\").generate_no_behavior()\n\t\t\tvar frame_dat = getFrameData(getCurrentFrame())\n\t\t\tframe_dat = Object.assign([], frame_dat)\n\t\t\tframe_dat.push(new_bbox)\n\t\t\tupdateFrameData(currframe_redux, frame_dat)\n\t\t\t//updateFrameData(currframe_redux, [new_bbox])\n\t\t}else if(annotationType === ANNOTATION_FRAME){\n\t\t\t//TODO Add annotation frame datapoint\n\t\t\tannotation_type_txt = \"f\"\n\t\t}\n\t\t\n\t\tvar saved_annot = getAnnotationData(getCurrentFrame())\n\t\tvar generated_annotation;\n\t\tif(inputType === INPUT_IMAGE){\n\t\t\tgenerated_annotation = create_annotation(boxCount+annotation_type_txt)\n\t\t}else{\n\t\t\tgenerated_annotation = create_annotation(boxCount+annotation_type_txt)\n\t\t}\n\t\tsaved_annot = Object.assign([], saved_annot)\n\t\tsaved_annot.push(generated_annotation)\n\t\tupdateAnnotationData(currframe_redux, saved_annot)\n\n\t\tsetBoxCount(boxCount + 1);\n\t}\n\n\n\tuseEffect(() =>{\n\t\tif(upload == true){\n\t\t\tsetCurrAnnotationData(getAnnotationData(currframe_redux))\n\t\t}\n\t}, [annot_redux])\n\n\tconst create_annotation = (id) => {\n\t\tvar columns = getColumnData()\n\t\tvar new_data = {}\n\t\tcolumns = columns['data']['columns']['columns']\n\t\tfor(var i = 0; i < columns.length; i++){\n\t\t\tvar curr_val = columns[i]\n\t\t\tnew_data[curr_val.accessor] = \"\"\n\t\t}\n\t\tif(inputType === INPUT_IMAGE){\n\t\t\tnew_data['dataType'] = \"image\"\n\t\t\tnew_data['fileName'] = \"temp\"//image_frames[currframe_redux]['name']\n\t\t}else{\n\t\t\tnew_data['dataType'] = \"video\"\n\t\t\tnew_data['fileName'] = \"frame_\" + currframe_redux\n\t\t}\n\t\tnew_data['id'] = id\n\t\treturn new_data\n\t}\n\n\tconst toggle_segmentation = (event) => {\n\t\tsegmentation_flag = !segmentation_flag\n\t}\n\n\tconst handleOldAnnotation = (event) => {\n\t\tvar promise = downloadOldAnnotation(event)\n\t\tpromise.then(function (result) {\n\t\t\tif(result != null){\n\t\t\t\tsetOldAnnotation(new ExtractingAnnotation(result, scaling_factor_width, scaling_factor_height));\n\t\t\t\tsetRes(result.vid_metadata.horizontal_res, result.vid_metadata.vertical_res)\n\t\t\t}else{\n\t\t\t\talert(\"Error in processing Annotation. Please check the file and try again.\")\n\t\t\t}\n\t\t})\n\t}\n\n\tuseEffect(() => {\n\t\t//TODO Find a more elegant solution. This is a temporay patch work.\n\t\tif(oldAnnotation == null){\n\t\t\treturn;\n\t\t}\n\t\tstore.dispatch({\n\t\t\ttype: \"frame_data/initOldAnnotation\",\n\t\t\tpayload: oldAnnotation.get_frame_data()\n\t\t});\n\t\tstore.dispatch({\n\t\t\ttype: \"annotation_data/initOldAnnotation\",\n\t\t\tpayload: oldAnnotation.get_annotation_data()\n\t\t});\n\t\tsetFrameRate(oldAnnotation.get_frame_rate())\n\t\tsetCurrAnnotationData(oldAnnotation.get_annotation_data()[0])\n\t\tsetBoxCount(oldAnnotation.find_highest_localid())\n\t}, [oldAnnotation]);\n\t\t\n\n\tuseEffect(() => { //This shold update the view upon column loading\n\t\tsetIsLoading(false)\n\t}, [column_redux])\n\n\n\tconst downloadOldAnnotation = (file) => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tvar reader = new FileReader();\n\t\t\treader.onload = function(e) {\n\t\t\t\tresolve((JSON.parse(e.target.result)));\n\t\t\t}\n\t\t\treader.readAsText(file.target.files[0])\n\t\t})\n\t}\n \n\tconst skip_frame_forward = e =>{\n\t\tvar frameVal = currframe_redux + skip_value\n\n\t\tif(frameVal >= metadata_redux['total_frames']){\n\t\t\tif(inputType === INPUT_IMAGE){\n\t\t\t\tsetCurrentFrame(metadata_redux['total_frames']-1)\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetCurrentFrame(metadata_redux['total_frames']-1)\n\t\t}else{\n\t\t\tif(inputType === INPUT_IMAGE){\n\t\t\t\tsetCurrentFrame(frameVal)\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetCurrentFrame(frameVal)\n\t\t}\n\t}\n\n\tconst skip_frame_backward = e => {\n\t\tvar frameVal = currframe_redux - skip_value\n\t\tif(frameVal < 0){\n\t\t\tif(inputType === INPUT_IMAGE){\n\t\t\t\tsetCurrentFrame(0)\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetCurrentFrame(0)\n\t\t}else{\n\t\t\tif(inputType === INPUT_IMAGE){\n\t\t\t\tsetCurrentFrame(frameVal)\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetCurrentFrame(frameVal)\n\t\t}\n\t}\n\n\tconst change_annotation_type = (event) => {\n\t\tsetAnnotationType(event)\n\t}\n\n\tconst onKeyPress = (event) =>{\n\t\t//Making sure input for textbox doesnt get counted as a mode change\n\t\tif(keyCheck === false){\n\t\t\treturn;\n\t\t}\n\t\tif(segmentation_flag === true){\n\t\t\talert(\"Please finish your current action!\")\n\t\t\treturn;\n\t\t}\n\t\tif (event.key === ANNOTATION_BBOX){\n\t\t\ttoast_text = \"Mode Switch: Bounding Box\"\n\t\t\tchangeSave(true)\n\t\t\tsetAnnotationType(ANNOTATION_BBOX)\n\t\t}else if (event.key === ANNOTATION_KEYPOINT){\n\t\t\ttoast_text = \"Mode Switch: Key Point\"\n\t\t\tchangeSave(true)\n\t\t\tsetAnnotationType(ANNOTATION_KEYPOINT)\n\t\t}else if(event.key === ANNOTATION_SEG) {\n\t\t\ttoast_text = \"Mode Switch: Segmentation\"\n\t\t\tchangeSave(true)\n\t\t\tsetAnnotationType(ANNOTATION_SEG)\n\t\t}else if(event.key === ANNOTATION_FRAME){\n\t\t\ttoast_text = \"Mode Switch: Behavior Annotation\"\n\t\t\tchangeSave(true)\n\t\t\tsetAnnotationType(ANNOTATION_FRAME)\n\t\t}else if (event.key === \"a\"){\n\t\t\tvar annotext = \"\"\n\t\t\tif(annotationType === ANNOTATION_BBOX){\n\t\t\t\tannotext = \"Bounding Box\"\n\t\t\t}else if(annotationType === ANNOTATION_FRAME){\n\t\t\t\tannotext = \"Behavior Data\"\n\t\t\t}else if (annotationType === ANNOTATION_KEYPOINT){\n\t\t\t\tannotext = \"Keypoint\"\n\t\t\t}else if (annotationType === ANNOTATION_SEG){\n\t\t\t\tannotext = \"Segmentation\"\n\t\t\t}\n\t\t\ttoast_text = \"Added Annotation - \" + annotext\n\t\t\tif(annotationType !== ANNOTATION_SEG){\n\t\t\t\tchangeSave(true)\n\t\t\t}\n\t\t\taddToCanvas()\n\t\t}else if (event.key === \"q\"){\n\t\t\tskip_frame_backward()\n\t\t}else if (event.key === \"e\"){\n\t\t\tskip_frame_forward()\n\t\t}else if(event.key === \"c\"){\n\t\t\t\n\t\t}\n\t} \n\n\tuseEffect(() => {\n\t\tdocument.addEventListener(\"keydown\", onKeyPress);\n\t\treturn () => document.removeEventListener(\"keydown\", onKeyPress);\n\t}, [onKeyPress]);\n\t\n\n\tconst handle_visual_toggle = () => {\n\t\tsetVisualToggle(Math.floor(Math.random() * 999999999999))\n\t}\n\n\tconst toggleKeyCheck = (toggle_val) => {\n\t\tconsole.log(\"Keycheck activated\")\n\t\tif(toggle_val === undefined){\n\t\t\tchangeKeyCheck(!keyCheck)\n\t\t}else{\n\t\t\tchangeKeyCheck(toggle_val)\n\t\t}\n\t}\n\n\tconst handleChangeAnnot = val => {\n\t\tsetCurrAnnotationData(val)\n\t}\n\n\tconst genFabricCanvas = () => {\n\t\tvar fcanvas = []\n\t\tfor(var i = 0; i < imagedata_redux.length; i++){\n\t\t\tlet canv = (\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t)\n\t\t\tfcanvas.push(canv)\n\t\t}\n\t\treturn(\n\t\t\t
\n\t\t\t{\n\t\t\t\tfcanvas.map((can, _) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tcan\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t}\n\t\t\t
\n\t\t)\n\t}\n\n\treturn (\n\t\t
\n\t\t\t\n\t\t\t changeSave(false)} \n\t\t\t\tshow={save} delay={500} autohide\n\t\t\t\tstyle={{ position: 'absolute', top: '100', left: '100', zIndex: '100'}}\n\t\t\t>\n\t\t\t\t\n\t\t\t\t\t{toast_text}\n\t\t\t\t\n\t\t\t\n\t\t\t{\n\t\t\t\tupload === true && \n\t\t\t\t
\n\t\t\t\t\t{genFabricCanvas()}\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t}\n\t\t\t{\n\t\t\t\tupload === false &&\n\t\t\t\t
\n\t\t\t\t\t\"Video/Image upload not detected. Please upload.\"\n\t\t\t\t
\n\t\t\t}\n\t\t
\n\t);\n}\n","export const ANNOTATION_FRAME = \"1\"\nexport const ANNOTATION_BBOX = \"2\"\nexport const ANNOTATION_SEG = \"3\"\nexport const ANNOTATION_KEYPOINT = \"4\"\n","\nimport React, { useState } from \"react\";\nimport 'bootstrap/dist/css/bootstrap.min.css';\n\nimport Button from 'react-bootstrap/Button'\nimport Modal from 'react-bootstrap/Modal'\nimport Carousel from 'react-bootstrap/Carousel'\n\nimport MainUpload from './main_upload'\nimport { Container, Jumbotron, Card} from \"react-bootstrap\";\nimport Instructions from \"../Components/instructions\";\n\nimport selection_items from '../../static_data/selectionscreen_info.json'\n\n//\"logo\"\nfunction SelectionScreen(){\n const [show, setShow] = useState(false);\n const handleClose = () => setShow(false);\n const [upload, setUpload] = useState(false)\n const handleUpload = (event) => {\n setUpload(!upload)\n }\n\n const [multiview, setMultiview] = useState(false)\n\n if(upload){\n return ()\n }else{\n return (\n
\n \n \n Instructions\n \n \n \n \n \n \n
\n \n \n

AVAT

\n

Analysis tool to record data for livestock behavior and computer vision applications.

\n

\n \n

\n
\n
\n \n {\n selection_items.map((item, key) => {\n return(\n \n \n \n \n {item.altText}\n {item.description}\n \n \n \n )\n })\n }\n \n
\n
\n )\n }\n}\n\nexport default SelectionScreen;","/**\n * @author Pradeep Senthil (pradeepsen99@gmail.com)\n * @\n */\n\n import React, { useState } from \"react\"; \n import ReactDOM from 'react-dom'\n import './App.css';\n import ReactPlayer from 'react-player'\n import 'bootstrap/dist/css/bootstrap.min.css';\n \n import FrontEnd from './ui_elements/Pages/main_upload'\n import SelectionScreen from './ui_elements/Pages/selection_screen'\n \n //\n function App() {\n return (\n
\n \n
\n );\n }\n //\n //\n //
\n //\n //\n //
\n \n export default App;","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' },\n })\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then(registration => {\n registration.unregister();\n })\n .catch(error => {\n console.error(error.message);\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nimport { Provider } from 'react-redux'\nimport store from './store'\n\n/* ReactDOM.render(\n ,\n document.getElementById('root')\n);\n */\n\n//REDUX code\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n\n/**\n * IF NEED TO RE-ENABLE STRICT MODE THEN UNNCOMMENT AND ADD BACK\n * \n * \n \n ,\n */\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""} \ No newline at end of file