Skip to content

Commit d154130

Browse files
authored
Merge pull request #99 from zc277584121/main
repair map mistake
2 parents ad0c727 + 0a2740b commit d154130

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

video/video_deduplication/1_video_deduplication_engine.ipynb

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "2a5baace",
5+
"id": "e06275b8",
66
"metadata": {},
77
"source": [
88
"# How to Build a Video Deduplication System\n",
@@ -27,7 +27,7 @@
2727
},
2828
{
2929
"cell_type": "markdown",
30-
"id": "69dfd6cf",
30+
"id": "9d953a08",
3131
"metadata": {},
3232
"source": [
3333
"## Preparation\n",
@@ -48,7 +48,7 @@
4848
{
4949
"cell_type": "code",
5050
"execution_count": 1,
51-
"id": "0042fbfa",
51+
"id": "469282e9",
5252
"metadata": {},
5353
"outputs": [],
5454
"source": [
@@ -57,7 +57,7 @@
5757
},
5858
{
5959
"cell_type": "markdown",
60-
"id": "9738ca63",
60+
"id": "e4f5a71c",
6161
"metadata": {},
6262
"source": [
6363
"### Prepare the data\n",
@@ -75,7 +75,7 @@
7575
{
7676
"cell_type": "code",
7777
"execution_count": 2,
78-
"id": "5023c1df",
78+
"id": "22543226",
7979
"metadata": {},
8080
"outputs": [],
8181
"source": [
@@ -86,7 +86,7 @@
8686
{
8787
"cell_type": "code",
8888
"execution_count": 3,
89-
"id": "72f01cdf",
89+
"id": "091912bc",
9090
"metadata": {
9191
"scrolled": true
9292
},
@@ -285,7 +285,7 @@
285285
},
286286
{
287287
"cell_type": "markdown",
288-
"id": "4d042c4c",
288+
"id": "ef4670d6",
289289
"metadata": {},
290290
"source": [
291291
"Define some helper function to convert video to gif so that we can have a look at these videos. "
@@ -294,7 +294,7 @@
294294
{
295295
"cell_type": "code",
296296
"execution_count": 4,
297-
"id": "99abfd40",
297+
"id": "3ea961d6",
298298
"metadata": {},
299299
"outputs": [],
300300
"source": [
@@ -334,7 +334,7 @@
334334
},
335335
{
336336
"cell_type": "markdown",
337-
"id": "619cae93",
337+
"id": "97440442",
338338
"metadata": {},
339339
"source": [
340340
"Positive denotes a video that is contain same content event in anchor video, while negative denotes an inconsistent."
@@ -343,7 +343,7 @@
343343
{
344344
"cell_type": "code",
345345
"execution_count": 5,
346-
"id": "4770d11c",
346+
"id": "88519061",
347347
"metadata": {
348348
"scrolled": true
349349
},
@@ -389,7 +389,7 @@
389389
},
390390
{
391391
"cell_type": "markdown",
392-
"id": "4999c2ed",
392+
"id": "5c707302",
393393
"metadata": {},
394394
"source": [
395395
"### Create a Milvus Collection\n",
@@ -400,7 +400,7 @@
400400
{
401401
"cell_type": "code",
402402
"execution_count": 6,
403-
"id": "208ab462",
403+
"id": "df83801e",
404404
"metadata": {},
405405
"outputs": [],
406406
"source": [
@@ -432,7 +432,7 @@
432432
{
433433
"cell_type": "code",
434434
"execution_count": 7,
435-
"id": "e9c9e6d8",
435+
"id": "ecd908ad",
436436
"metadata": {},
437437
"outputs": [],
438438
"source": [
@@ -441,7 +441,7 @@
441441
},
442442
{
443443
"cell_type": "markdown",
444-
"id": "6d4281ad",
444+
"id": "7acaf86b",
445445
"metadata": {},
446446
"source": [
447447
"## Video Copy Detection\n",
@@ -453,7 +453,7 @@
453453
},
454454
{
455455
"cell_type": "markdown",
456-
"id": "5eac8eac",
456+
"id": "5fdcd9b8",
457457
"metadata": {},
458458
"source": [
459459
"### Load Video Embeddings into Milvus\n",
@@ -464,15 +464,15 @@
464464
{
465465
"cell_type": "code",
466466
"execution_count": 8,
467-
"id": "9f36c5df",
467+
"id": "1dc07d2d",
468468
"metadata": {},
469469
"outputs": [
470470
{
471471
"name": "stdout",
472472
"output_type": "stream",
473473
"text": [
474-
"CPU times: user 26min 27s, sys: 15.9 s, total: 26min 42s\n",
475-
"Wall time: 1min 56s\n"
474+
"CPU times: user 26min 10s, sys: 14.1 s, total: 26min 24s\n",
475+
"Wall time: 1min 55s\n"
476476
]
477477
}
478478
],
@@ -496,7 +496,7 @@
496496
},
497497
{
498498
"cell_type": "markdown",
499-
"id": "e6c9fe9a",
499+
"id": "f96e5c4b",
500500
"metadata": {},
501501
"source": [
502502
"Here is detailed explanation for each line of the code:\n",
@@ -515,7 +515,7 @@
515515
{
516516
"cell_type": "code",
517517
"execution_count": 9,
518-
"id": "5102998a",
518+
"id": "2738a2b3",
519519
"metadata": {
520520
"scrolled": true
521521
},
@@ -540,7 +540,7 @@
540540
{
541541
"cell_type": "code",
542542
"execution_count": 10,
543-
"id": "441801e0",
543+
"id": "97e3f3f7",
544544
"metadata": {},
545545
"outputs": [
546546
{
@@ -557,7 +557,7 @@
557557
},
558558
{
559559
"cell_type": "markdown",
560-
"id": "d1697e68",
560+
"id": "4af2a4e3",
561561
"metadata": {},
562562
"source": [
563563
"## Evaluation\n",
@@ -571,15 +571,15 @@
571571
{
572572
"cell_type": "code",
573573
"execution_count": 11,
574-
"id": "b36f69ca",
574+
"id": "81b8b5ed",
575575
"metadata": {},
576576
"outputs": [
577577
{
578578
"name": "stdout",
579579
"output_type": "stream",
580580
"text": [
581-
"CPU times: user 5min 20s, sys: 2.28 s, total: 5min 23s\n",
582-
"Wall time: 21.9 s\n"
581+
"CPU times: user 4min 16s, sys: 3.15 s, total: 4min 19s\n",
582+
"Wall time: 20.9 s\n"
583583
]
584584
}
585585
],
@@ -600,7 +600,7 @@
600600
{
601601
"cell_type": "code",
602602
"execution_count": 12,
603-
"id": "eb79042a",
603+
"id": "249ab799",
604604
"metadata": {},
605605
"outputs": [
606606
{
@@ -623,7 +623,7 @@
623623
{
624624
"cell_type": "code",
625625
"execution_count": 13,
626-
"id": "b68adbdf",
626+
"id": "a026d731",
627627
"metadata": {},
628628
"outputs": [
629629
{
@@ -652,16 +652,16 @@
652652
" </thead>\n",
653653
" <tbody>\n",
654654
" <tr>\n",
655-
" <th>recall_at_k</th>\n",
655+
" <th>map_at_k</th>\n",
656656
" <td>0.973977</td>\n",
657657
" </tr>\n",
658658
" </tbody>\n",
659659
"</table>\n",
660660
"</div>"
661661
],
662662
"text/plain": [
663-
" mean_average_precision\n",
664-
"recall_at_k 0.973977"
663+
" mean_average_precision\n",
664+
"map_at_k 0.973977"
665665
]
666666
},
667667
"metadata": {},
@@ -671,22 +671,22 @@
671671
"source": [
672672
"benchmark = (\n",
673673
" dc.with_metrics(['mean_average_precision',]) \\\n",
674-
" .evaluate['ground_truth_event', 'topk_events'](name='recall_at_k') \\\n",
674+
" .evaluate['ground_truth_event', 'topk_events'](name='map_at_k') \\\n",
675675
" .report()\n",
676676
")"
677677
]
678678
},
679679
{
680680
"cell_type": "markdown",
681-
"id": "51de65b0",
681+
"id": "a2003b8d",
682682
"metadata": {},
683683
"source": [
684684
"We found that we achieved an excellent topk metric on this easy small dataset, which means that if we limit each event to have k duplicate videos, then they can all be almost recalled and they are almost true positive ."
685685
]
686686
},
687687
{
688688
"cell_type": "markdown",
689-
"id": "6373bddd",
689+
"id": "c1b44a40",
690690
"metadata": {},
691691
"source": [
692692
"## Show query results\n",
@@ -697,7 +697,7 @@
697697
{
698698
"cell_type": "code",
699699
"execution_count": 14,
700-
"id": "8c96f4b1",
700+
"id": "6d461033",
701701
"metadata": {},
702702
"outputs": [
703703
{
@@ -735,7 +735,7 @@
735735
{
736736
"cell_type": "code",
737737
"execution_count": 15,
738-
"id": "7cb4c0d7",
738+
"id": "486b42fd",
739739
"metadata": {},
740740
"outputs": [
741741
{
@@ -759,7 +759,7 @@
759759
{
760760
"cell_type": "code",
761761
"execution_count": 16,
762-
"id": "9ca15405",
762+
"id": "b971fb56",
763763
"metadata": {
764764
"scrolled": true
765765
},
@@ -785,7 +785,7 @@
785785
{
786786
"cell_type": "code",
787787
"execution_count": 17,
788-
"id": "439afc5d",
788+
"id": "56e0526b",
789789
"metadata": {},
790790
"outputs": [
791791
{
@@ -809,7 +809,7 @@
809809
{
810810
"cell_type": "code",
811811
"execution_count": 18,
812-
"id": "9aa5f6a1",
812+
"id": "549fb90f",
813813
"metadata": {},
814814
"outputs": [],
815815
"source": [
@@ -820,7 +820,7 @@
820820
{
821821
"cell_type": "code",
822822
"execution_count": null,
823-
"id": "433957bf",
823+
"id": "d406323c",
824824
"metadata": {},
825825
"outputs": [],
826826
"source": []

0 commit comments

Comments
 (0)