Spaces:
Running
Running
Update index.js
Browse files
index.js
CHANGED
|
@@ -16,7 +16,6 @@ const THRESHOLD = 0.2;
|
|
| 16 |
status.textContent = 'Loading model...';
|
| 17 |
const model_id = 'onnx-community/yolov10m';
|
| 18 |
const processor = await AutoProcessor.from_pretrained(model_id);
|
| 19 |
-
console.log('processor', processor.feature_extractor.do_flip_channel_order);
|
| 20 |
const model = await AutoModel.from_pretrained(model_id, { quantized: true });
|
| 21 |
status.textContent = 'Ready';
|
| 22 |
|
|
@@ -89,7 +88,7 @@ function renderBox([xmin, ymin, xmax, ymax, score, id], [w, h]) {
|
|
| 89 |
|
| 90 |
// Draw label
|
| 91 |
const labelElement = document.createElement('span');
|
| 92 |
-
labelElement.textContent = `${model.config.id2label[id]}
|
| 93 |
labelElement.className = 'bounding-box-label';
|
| 94 |
labelElement.style.backgroundColor = color;
|
| 95 |
|
|
|
|
| 16 |
status.textContent = 'Loading model...';
|
| 17 |
const model_id = 'onnx-community/yolov10m';
|
| 18 |
const processor = await AutoProcessor.from_pretrained(model_id);
|
|
|
|
| 19 |
const model = await AutoModel.from_pretrained(model_id, { quantized: true });
|
| 20 |
status.textContent = 'Ready';
|
| 21 |
|
|
|
|
| 88 |
|
| 89 |
// Draw label
|
| 90 |
const labelElement = document.createElement('span');
|
| 91 |
+
labelElement.textContent = `${model.config.id2label[id]} (${score.toFixed(2)})`.replaceAll(' ', '\u00a0');
|
| 92 |
labelElement.className = 'bounding-box-label';
|
| 93 |
labelElement.style.backgroundColor = color;
|
| 94 |
|