RashiAgarwal commited on
Commit
18ff9ad
1 Parent(s): 917ece0

Update display.py

Browse files
Files changed (1) hide show
  1. display.py +5 -1
display.py CHANGED
@@ -15,7 +15,11 @@ def inference(image: np.ndarray, iou_thresh: float = 0.5, thresh: float = 0.5,sh
15
  # iou_thresh = 0.75
16
  # thresh = 0.75
17
  scaled_anchors = config.SCALED_ANCHORS
18
- cam = YoloCAM(model=model, target_layers=[model.layers.26.conv,model.layers.28.conv], use_cuda=False)
 
 
 
 
19
  transforms = A.Compose(
20
  [
21
  A.LongestMaxSize(max_size=config.IMAGE_SIZE),
 
15
  # iou_thresh = 0.75
16
  # thresh = 0.75
17
  scaled_anchors = config.SCALED_ANCHORS
18
+
19
+ backbone = model
20
+ target_layer_list = list(backbone.children())[-2:]
21
+
22
+ cam = YoloCAM(model=model, target_layers = target_layer_list, use_cuda=False)
23
  transforms = A.Compose(
24
  [
25
  A.LongestMaxSize(max_size=config.IMAGE_SIZE),