Repository navigation
Conversation
mzur
left a comment
There was a problem hiding this comment.
Video annotation labels currently have no confidence attribute at all.
More comments below.
| $this->validate($request, [ | ||
| 'take' => 'integer', | ||
| 'shape_id' => 'array', | ||
| 'shape_id.*' => 'integer', | ||
| 'user_id' => 'array', | ||
| 'user_id.*' => 'integer', | ||
| 'union' => 'boolean', | ||
| $this->validate($request, [ | ||
| 'session_id' => 'filled|exists:annotation_sessions,id', | ||
| 'shape_id' => 'filled|array', | ||
| 'shape_id.*' => 'exists:shapes,id', | ||
| 'user_id' => 'filled|array', | ||
| 'user_id.*' => 'exists:users,id', | ||
| 'confidence' => 'filled|array', | ||
| 'confidence.*' => 'in:0,1,2,3,4', | ||
| ]); |
There was a problem hiding this comment.
- Please fix the indentation
- Why was
takeandunionremoved? - Why is
session_idadded? It makes no sense in the project controller. - Why is
confidencean array? Shouldn't be a scalar threshold?
| if ($union) { | ||
| $query->where(function ($q) use ($confidenceValues) { | ||
| foreach ($confidenceValues as $value) { | ||
| if ($value < 0) { | ||
| $q->orWhereRaw($this->getConfidenceQuery(abs($value))); | ||
| } else { | ||
| $q->orWhereRaw($this->getConfidenceQuery($value)); | ||
| } | ||
| } | ||
| }); | ||
| } else { | ||
| foreach ($confidenceValues as $value) { | ||
| if ($value < 0) { | ||
| $query->whereRaw($this->getConfidenceQuery(abs($value))); | ||
| } else { | ||
| $query->whereRaw($this->getConfidenceQuery($value)); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Remove confidence from filters array to avoid double processing | ||
| unset($filters['confidence']); | ||
| } |
There was a problem hiding this comment.
This should be added to compileFilterConditions() instead.
| $this->validate($request, [ | ||
| 'session_id' => 'filled|exists:annotation_sessions,id', | ||
| 'shape_id' => 'filled|array', | ||
| 'shape_id.*' => 'exists:shapes,id', | ||
| 'user_id' => 'filled|array', | ||
| 'user_id.*' => 'exists:users,id', | ||
| 'confidence' => 'filled|array', | ||
| 'confidence.*' => 'in:0,1,2,3,4', |
There was a problem hiding this comment.
Same than above. This breaks the whole filtering mechanism.
Same in the files below.
| if ($union) { | ||
| $query->where(function ($q) use ($confidenceValues) { | ||
| foreach ($confidenceValues as $value) { | ||
| if ($value < 0) { | ||
| $q->orWhereRaw($this->getConfidenceQuery(abs($value))); | ||
| } else { | ||
| $q->orWhereRaw($this->getConfidenceQuery($value)); | ||
| } | ||
| } | ||
| }); | ||
| } else { | ||
| foreach ($confidenceValues as $value) { | ||
| if ($value < 0) { | ||
| $query->whereRaw($this->getConfidenceQuery(abs($value))); | ||
| } else { | ||
| $query->whereRaw($this->getConfidenceQuery($value)); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Remove confidence from filters array to avoid double processing | ||
| unset($filters['confidence']); | ||
| } |
There was a problem hiding this comment.
Same than above. Same in the files below.
| User: {}, | ||
| Confidence: { | ||
| 0: 'Very low (0 - 0.25)', | ||
| 1: 'Low (0.25 - 0.5)', | ||
| 2: 'Medium (0.5 - 0.75)', | ||
| 3: 'High (0.75 - 0.9)', | ||
| 4: 'Very high (0.9 - 1.0)' | ||
| } | ||
| }, |
There was a problem hiding this comment.
This could be a chance to add > and < operators to filter conditions. Instead of fixed intervals, users can enter one rule >0.25 and another <0.5 to get the same thing.
|
I would close this one, as this might be out of scope since we likely mainly focus on manual annotations in Biigle for now. @mzur Are you ok with this, or should I revisit this one? |
|
Feel free to close. The confidence is in limbo since forever with neither a strong opinion for or against it. I think it will become useful when we implement the AI annotation flag and then we can come back to this filter. You should add the idea to the top comment in #1166 so we don't forget about it. |
Allows to filter annotations in largo by confidence as proposed in #1166.