Skip to content

Commit

Permalink
chore: fix default column + object saving
Browse files Browse the repository at this point in the history
  • Loading branch information
pradeepsen99 committed Mar 24, 2024
1 parent be3fc29 commit 607b09a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/ui_elements/Components/fabric_canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ export default function FabricRender(props){

temp_fabricCanvas.on('object:modified', function (event) {
this.objDrag = true;
updateFrameData(currframe_redux, temp_fabricCanvas.getObjects())
const currentFrame = store.getState().current_frame['data']
updateFrameData(currentFrame, temp_fabricCanvas.getObjects())
});

temp_fabricCanvas.on('mouse:down', function(opt) {
Expand Down Expand Up @@ -147,7 +148,7 @@ export default function FabricRender(props){

useEffect(() => {
if(fabricCanvas){
save_data(frameToUpdate, "frame_change")
// save_data(frameToUpdate, "frame_change")
setFrameToUpdate(currframe_redux)
var video = document.getElementsByTagName('video')[props.stream_num]
if(upload == true){
Expand Down
7 changes: 6 additions & 1 deletion src/ui_elements/Components/upload_modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { useSelector } from "react-redux";
import { initFrameData, updateFrameData, getFrameData, initAnnotationData, updateAnnotationData, getAnnotationData, initColumnData, setMedia, initMedia, setFrameRate, setMediaType, setSkipValue, getMetaData, togglePlay, setTotalFrames } from '../../processing/actions'
import { init } from '../../reducer/frame_data';
import media_data from '../../reducer/media_data';
import default_column from '../../static_data/basic_column_config.json'

export default function UploadModal(props){
const [show, setShow] = useState(false);
Expand Down Expand Up @@ -47,7 +48,11 @@ export default function UploadModal(props){
}
setTotalFrames(totalFrames)
initFrameData(totalFrames)
initColumnData(stateColumnData)
if (stateColumnData == null) {
initColumnData(default_column)
}else{
initColumnData(stateColumnData)
}
initAnnotationData(totalFrames)
}else if(uploadExistingAnnotation){
initColumnData(stateColumnData)
Expand Down
6 changes: 3 additions & 3 deletions src/ui_elements/Pages/main_upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,9 @@ export default function MainUpload() {
changeSave(true)
setAnnotationType(ANNOTATION_KEYPOINT)
}else if(event.key === ANNOTATION_SEG) {
toast_text = "Mode Switch: Segmentation"
changeSave(true)
setAnnotationType(ANNOTATION_SEG)
// toast_text = "Mode Switch: Segmentation"
// changeSave(true)
// setAnnotationType(ANNOTATION_SEG)
}else if(event.key === ANNOTATION_FRAME){
toast_text = "Mode Switch: Behavior Annotation"
changeSave(true)
Expand Down

0 comments on commit 607b09a

Please sign in to comment.