prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Add tutorial with hard negative samples
  ## 📓 Documentation Update
  "how to use an image as background annotation" is a common question. We can provide a tutorial showing how to do that
  
  ### Racoon and dogs
  If you train a model on the racoon dataset and show the model a picture of a dog it will classify it as a racoon. We can add images of dogs to the dataset (without any annotations) and show how the difference of model performance in both scenarios.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `icevision/models/base_show_results.py`
  Content:
  ```
  1 __all__ = ["base_show_results"]
  2 
  3 from icevision.imports import *
  4 from icevision.utils import *
  5 from icevision.core import *
  6 from icevision.visualize import *
  7 from icevision.data import *
  8 
  9 
  10 def base_show_results(
  11     predict_fn: callable,
  12     build_infer_batch_fn: callable,
  13     model: nn.Module,
  14     dataset: Dataset,
  15     class_map: Optional[ClassMap] = None,
  16     num_samples: int = 6,
  17     ncols: int = 3,
  18     denormalize_fn: Optional[callable] = denormalize_imagenet,
  19     show: bool = True,
  20 ) -> None:
  21     samples = [dataset[i] for i in range(num_samples)]
  22     batch, samples = build_infer_batch_fn(samples)
  23     preds = predict_fn(model, batch)
  24 
  25     imgs = [sample["img"] for sample in samples]
  26     show_preds(
  27         imgs,
  28         preds,
  29         class_map=class_map,
  30         denormalize_fn=denormalize_fn,
  31         ncols=ncols,
  32         show=show,
  33     )
  34
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/icevision/models/base_show_results.py b/icevision/models/base_show_results.py
  --- a/icevision/models/base_show_results.py
  +++ b/icevision/models/base_show_results.py
  @@ -18,7 +18,7 @@
       denormalize_fn: Optional[callable] = denormalize_imagenet,
       show: bool = True,
   ) -> None:
  -    samples = [dataset[i] for i in range(num_samples)]
  +    samples = random.choices(dataset, k=num_samples)
       batch, samples = build_infer_batch_fn(samples)
       preds = predict_fn(model, batch)
  
verification_info: {"golden_diff": "diff --git a/icevision/models/base_show_results.py b/icevision/models/base_show_results.py\n--- a/icevision/models/base_show_results.py\n+++ b/icevision/models/base_show_results.py\n@@ -18,7 +18,7 @@\n     denormalize_fn: Optional[callable] = denormalize_imagenet,\n     show: bool = True,\n ) -> None:\n-    samples = [dataset[i] for i in range(num_samples)]\n+    samples = random.choices(dataset, k=num_samples)\n     batch, samples = build_infer_batch_fn(samples)\n     preds = predict_fn(model, batch)\n", "issue": "Add tutorial with hard negative samples\n## \ud83d\udcd3 Documentation Update\r\n\"how to use an image as background annotation\" is a common question. We can provide a tutorial showing how to do that\r\n\r\n### Racoon and dogs\r\nIf you train a model on the racoon dataset and show the model a picture of a dog it will classify it as a racoon. We can add images of dogs to the dataset (without any annotations) and show how the difference of model performance in both scenarios.\n", "before_files": [{"content": "__all__ = [\"base_show_results\"]\n\nfrom icevision.imports import *\nfrom icevision.utils import *\nfrom icevision.core import *\nfrom icevision.visualize import *\nfrom icevision.data import *\n\n\ndef base_show_results(\n    predict_fn: callable,\n    build_infer_batch_fn: callable,\n    model: nn.Module,\n    dataset: Dataset,\n    class_map: Optional[ClassMap] = None,\n    num_samples: int = 6,\n    ncols: int = 3,\n    denormalize_fn: Optional[callable] = denormalize_imagenet,\n    show: bool = True,\n) -> None:\n    samples = [dataset[i] for i in range(num_samples)]\n    batch, samples = build_infer_batch_fn(samples)\n    preds = predict_fn(model, batch)\n\n    imgs = [sample[\"img\"] for sample in samples]\n    show_preds(\n        imgs,\n        preds,\n        class_map=class_map,\n        denormalize_fn=denormalize_fn,\n        ncols=ncols,\n        show=show,\n    )\n", "path": "icevision/models/base_show_results.py"}], "after_files": [{"content": "__all__ = [\"base_show_results\"]\n\nfrom icevision.imports import *\nfrom icevision.utils import *\nfrom icevision.core import *\nfrom icevision.visualize import *\nfrom icevision.data import *\n\n\ndef base_show_results(\n    predict_fn: callable,\n    build_infer_batch_fn: callable,\n    model: nn.Module,\n    dataset: Dataset,\n    class_map: Optional[ClassMap] = None,\n    num_samples: int = 6,\n    ncols: int = 3,\n    denormalize_fn: Optional[callable] = denormalize_imagenet,\n    show: bool = True,\n) -> None:\n    samples = random.choices(dataset, k=num_samples)\n    batch, samples = build_infer_batch_fn(samples)\n    preds = predict_fn(model, batch)\n\n    imgs = [sample[\"img\"] for sample in samples]\n    show_preds(\n        imgs,\n        preds,\n        class_map=class_map,\n        denormalize_fn=denormalize_fn,\n        ncols=ncols,\n        show=show,\n    )\n", "path": "icevision/models/base_show_results.py"}]}