Add Ego4D AV assisted annotation review workflow
This commit is contained in:
@@ -102,8 +102,14 @@ function formatTime(value) {
|
||||
return `${String(minutes).padStart(2, "0")}:${(seconds % 60).toFixed(1).padStart(4, "0")}`;
|
||||
}
|
||||
|
||||
function participantCode(value) {
|
||||
const raw = String(value ?? "?");
|
||||
return /^(p|person|wearer)/i.test(raw) ? raw : `P${raw}`;
|
||||
}
|
||||
|
||||
function participantIdentity(row, verbose = false) {
|
||||
const participant = `P${row.participant_id ?? "?"}`;
|
||||
const raw = String(row.participant_id ?? "?");
|
||||
const participant = participantCode(raw);
|
||||
if (row.participant_role === "wearer") {
|
||||
return verbose ? `W · ${participant} · wearer` : `W · ${participant}`;
|
||||
}
|
||||
@@ -282,7 +288,7 @@ function renderDetail(detail) {
|
||||
for (const option of opportunityOptions) {
|
||||
const control = document.createElement("option");
|
||||
control.value = option.uid;
|
||||
control.textContent = `${formatTime(option.anchor_seconds)} · P${option.participant_id ?? "?"} · ${option.transcription || "无转写"}`;
|
||||
control.textContent = `${formatTime(option.anchor_seconds)} · ${participantCode(option.participant_id)} · ${option.transcription || "无转写"}`;
|
||||
elements.opportunitySelect.append(control);
|
||||
}
|
||||
elements.saveState.textContent = detail.review ? "已保存" : "未保存";
|
||||
@@ -501,7 +507,7 @@ function renderSpeakerTimeline(detail) {
|
||||
const opportunity = document.createElement("i");
|
||||
opportunity.className = "opportunity-anchor";
|
||||
opportunity.style.left = `${100 * (Number(option.anchor_seconds) - left) / span}%`;
|
||||
opportunity.title = `可选 release · ${formatTime(option.anchor_seconds)} · P${option.participant_id ?? "?"}`;
|
||||
opportunity.title = `可选 release · ${formatTime(option.anchor_seconds)} · ${participantCode(option.participant_id)}`;
|
||||
track.append(opportunity);
|
||||
}
|
||||
const anchor = document.createElement("i");
|
||||
|
||||
Reference in New Issue
Block a user