Skip to content

erasaur/adversarial-patch-object-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

On Physical Adversarial Patches for Object Detection

Code for https://arxiv.org/pdf/1906.11897.pdf.

Warning: this code is old and mainly experimental.

The yolov3 implementation used is here. The following diff should be applied to the yolov3 code in order to run properly:

diff --git a/models.py b/models.py
index 1c9ba57..5a57b4c 100644
--- a/models.py
+++ b/models.py
@@ -173,7 +173,13 @@ class YOLOLayer(nn.Module):

             nProposals = int((pred_conf > 0.5).sum().item())
             recall = float(nCorrect / nGT) if nGT else 1
-            precision = float(nCorrect / nProposals)
+            # precision = float(nCorrect / nProposals)
+            if nProposals:
+                precision = float(nCorrect / nProposals)
+            elif nCorrect:
+                precision = 0
+            else:
+                precision = 1

             # Handle masks
             mask = Variable(mask.type(ByteTensor))

Releases

No releases published

Packages

No packages published