Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering improvements #182

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1c473e9
Update review superpixels order on sort order toggle
Jan 22, 2025
65373cd
Fix some bugs with the comparison filters
Jan 22, 2025
59859c0
Update the groupBy options
Jan 22, 2025
fb2e8bf
Update the sortBy options
Jan 22, 2025
45cbfbf
Add simple option to filter by labeled superpixels
Jan 22, 2025
65b854c
Update the reviews filter menu to better match labels
Jan 22, 2025
e022485
Use tri-state for "select all" checkboxes
Jan 29, 2025
889ff2e
Do not always call filter/sort/group on comparison change
Jan 29, 2025
8e0d83f
Do not set selectedSuperpixel until list is ready
Jan 29, 2025
78f7cb4
Improve change log naming; remove redundant code
bnmajor Feb 11, 2025
60e75cb
Improve disabling for comparison filtering
bnmajor Feb 11, 2025
412427e
Make sure local state is in sync with annotation metadata
bnmajor Feb 11, 2025
3a5c1a6
Use a more thorough check for valid metadata values
bnmajor Feb 17, 2025
c4f0932
Do not try to select a review superpixel if there are none
bnmajor Feb 17, 2025
14113cc
Prevent console error on initial review load
bnmajor Feb 17, 2025
c0b5871
Make sure list items are clickable, not just text
bnmajor Feb 17, 2025
1793b52
Add a bit more margin when grouped by labels
bnmajor Feb 17, 2025
b853d2a
Add "labels" and "reviews" options to comparison filtering
bnmajor Feb 17, 2025
d63dd8a
Re-write the filterByComaprison function
bnmajor Feb 17, 2025
2c7370f
Prevent console error from styling request
bnmajor Feb 17, 2025
63d2648
Do not use review watcher to save metadata
bnmajor Feb 18, 2025
f632c22
Make sure all menu option labels are clickable
bnmajor Feb 18, 2025
56da328
Show feedback when no results are found
bnmajor Feb 18, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import ActiveLearningGlobalContainer from '../vue/components/ActiveLearningGloba
import ActiveLearningToolBar from '../vue/components/ActiveLearningToolBar.vue';
import { store, assignHotkey } from '../vue/components/store.js';
import { activeLearningSteps } from '../vue/components/constants.js';
import { debounce } from '../vue/components/utils.js';
import { debounce, isValidNumber } from '../vue/components/utils.js';

import '../../stylesheets/body/learning.styl';

Expand Down Expand Up @@ -129,7 +129,7 @@ const ActiveLearningView = View.extend({
const idx = _.findIndex([...this.categoryMap.values()], (c) => c.label === l);
return idx === -1 ? null : idx - 1;
});
store.exclusions = _.reject(excluded, (v) => !_.isNumber(v));
store.exclusions = _.reject(excluded, (v) => !isValidNumber(v));

return this.fetchFoldersAndItems();
});
Expand Down Expand Up @@ -667,7 +667,7 @@ const ActiveLearningView = View.extend({
const annotation = values.labels.get('annotation');
if (annotation) {
_.forEach(Object.entries(annotation.attributes.metadata), ([k, v]) => {
if (_.isNumber(v.reviewValue) && v.reviewEpoch >= v.labelEpoch) {
if (isValidNumber(v.reviewValue) && v.reviewEpoch >= v.labelEpoch) {
annotation.elements[0].values[k] = v.reviewValue;
if (!imageIds.includes(annotation.itemId)) {
imageIds.push(annotation.itemId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Vue from 'vue';
import _ from 'underscore';

import { store, nextCard } from '../store';
import { updateMetadata } from '../utils';

export default Vue.extend({
props: ['index'],
Expand Down Expand Up @@ -113,9 +112,7 @@ export default Vue.extend({

// Force computed values to update
store.categoriesAndIndices = [...store.categoriesAndIndices];
updateMetadata(this.superpixelDecision, newValue, false);
store.backboneParent.updateAnnotationMetadata(store.currentImageId);
store.guidedChangeLog.push(this.superpixelDecision);
store.labelingChangeLog.push(this.superpixelDecision);
},
lastCategorySelected(categoryNumber) {
if (!this.isSelected || typeof categoryNumber !== 'number') {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script>
import Vue from 'vue';
import _ from 'underscore';

import ActiveLearningInitialSuperpixels from './ActiveLearningSetup/ActiveLearningInitialSuperpixels.vue';
import ActiveLearningMergeConfirmation from './ActiveLearningSetup/ActiveLearningMergeConfirmation.vue';
Expand Down Expand Up @@ -114,10 +113,6 @@ export default Vue.extend({
store.categories = [...this.categoryMap.values()];
store.currentImageId = Object.keys(this.imageNamesById)[0];

// Default to filtering out unlabeled superpixels
const cats = _.map(_.rest(store.categories), (cat) => `label_${cat.label}`);
store.filterBy = [...store.filterBy, ...cats];

// We don't want to mount child components until the store has been updated
this.storeReady = true;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Vue from 'vue';
import _ from 'underscore';

import { store } from '../store';
import { updateMetadata } from '../utils';
import { isValidNumber, updateMetadata } from '../utils';

export default Vue.extend({
props: ['superpixel', 'previewSize', 'cardDetails', 'reviewValue'],
Expand Down Expand Up @@ -81,7 +81,7 @@ export default Vue.extend({
},
reviewerCategorySelection: {
get() {
if (!_.isNumber(this.superpixel.reviewValue)) {
if (!isValidNumber(this.superpixel.reviewValue)) {
return this.superpixel.selectedCategory;
}
return this.superpixel.reviewValue;
Expand All @@ -95,11 +95,10 @@ export default Vue.extend({
// Index (newCategory) -1 indicates "Approve" or "Clear Review". If we are approving
// then we are setting the reviewValue to the selectedCategory. If we are clearing the
// review we are setting the reviewValue to null.
newCategory = _.isNumber(this.superpixel.reviewValue) ? null : this.superpixel.selectedCategory;
newCategory = isValidNumber(this.superpixel.reviewValue) ? null : this.superpixel.selectedCategory;
}

updateMetadata(this.superpixel, newCategory, true);
store.backboneParent.updateAnnotationMetadata(this.superpixel.imageId);
}
}
},
Expand Down
Loading