Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions default/methods/report/report_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@ def run(self):
self.query = self.query.order_by(self.date_func)

elif self.report_template.group_by == 'label':
self.query = self.query.group_by(self.label_file_id)
if hasattr(self, 'label_file_id'):
self.query = self.query.group_by(self.label_file_id)

elif self.report_template.group_by == 'user':
self.query = self.query.group_by(self.member_id_normalized)
Expand Down Expand Up @@ -670,9 +671,13 @@ def filter_by_label_file_id_list(self, label_file_id_list: list):
"""
label_file_id_list: List of ints ids
"""
if self.base_class_string == 'task':
self.query = self.query.filter(
self.base_class.file_id.in_(label_file_id_list))

self.query = self.query.filter(
self.base_class.label_file_id.in_(label_file_id_list))
else:
self.query = self.query.filter(
self.base_class.label_file_id.in_(label_file_id_list))

def update_report_template(self, metadata: dict):
"""
Expand Down Expand Up @@ -955,7 +960,10 @@ def group_by_label(self):
WIP only really for Instance
Yes this must use an id it look like for group by
"""
query = self.session.query(self.label_file_id, func.count(self.base_class.id))
if hasattr(self, 'label_file_id'):
query = self.session.query(self.label_file_id, func.count(self.base_class.id))
else:
query = self.session.query(self.base_class)
return query

def group_by_file(self):
Expand Down
11 changes: 5 additions & 6 deletions frontend/src/components/video/video.vue
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,7 @@

Do NOT 2 way bind this component, we expect the events to update frame number
We do want to send the current video frame number to this though so that
It can update as it plays.

--->
It can update as it plays. --->
<v-slider
ref="slider"
data-cy="video_player_slider"
Expand Down Expand Up @@ -607,7 +605,10 @@ export default Vue.extend( {

this.keyframe_watcher()
this.video_pause() // in case video was still playing

if(this.$refs.video_source_ref){
this.$refs.video_source_ref.src = "";
this.$refs.video_source_ref.load();
}
},
methods: {
reset_cache(){
Expand Down Expand Up @@ -1360,15 +1361,13 @@ export default Vue.extend( {
) {
return
}
console.log('get_video_single_image')
this.get_video_single_image_last_fired = new Date().getTime()

this.video_current_frame_guess_update()
const next_frames = this.get_next_n_frames(frame_number, this.MAX_NUM_URL_BUFFER)
const prev_frames = this.get_previous_n_frames(frame_number, this.MAX_NUM_URL_BUFFER)
const all_new_frames = [...new Set(next_frames.concat(prev_frames))];
if (frame_number != this.prior_frame_number) {
console.log('frame_number != this.prior_frame_number')
if(!this.frame_url_buffer[frame_number]){
this.error = {}
try{
Expand Down
21 changes: 19 additions & 2 deletions frontend/src/components/vue_canvas/video_drawable_canvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ import {KeypointInstance} from "./instances/KeypointInstance";
show_video_nav_bar:{
default: true
},

reticle_colour: {
default: () => ({
hex: '#ff0000',
Expand All @@ -147,6 +148,7 @@ import {KeypointInstance} from "./instances/KeypointInstance";
loading: false,
hovered: false,
is_mounted: false,
loading_images: [],
annotations_loading: false,
get_instances_loading: false,
refresh: new Date(),
Expand All @@ -172,6 +174,12 @@ import {KeypointInstance} from "./instances/KeypointInstance";
//console.debug("Destroyed")
document.removeEventListener('focusin', this.focus_in)
document.removeEventListener('focusout', this.focus_out)
if(window.stop !== undefined) {
window.stop();
}
else if(document.execCommand !== undefined){
document.execCommand("Stop", false);
}
},
watch: {
instance_list: function(){
Expand Down Expand Up @@ -396,19 +404,28 @@ import {KeypointInstance} from "./instances/KeypointInstance";
addImageProcess: function (src) {
return new Promise((resolve, reject) => {
let image = new Image()
this.loading_images.push(image)

image.src = src
if(process.env.NODE_ENV === 'testing'){
image.crossOrigin = "anonymous";
}
image.onload = () => resolve(image)
image.onload = () => {
this.loading_images = this.loading_images.filter(function(elm){
return elm !== image;
});
resolve(image)
}
image.onerror = reject
})
},
load_video_frame_from_url: function (url) {
var self = this
self.addImageProcess(url).then(image => {
self.html_image = image
self.$refs.drawable_canvas.canvas_wrapper.style.display = ""
if(self.$refs.drawable_canvas){
self.$refs.drawable_canvas.canvas_wrapper.style.display = ""
}
self.loading = false
this.refresh = Date.now();
})
Expand Down