"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "91b62f5a785264b626ec7ba708c894ac0276f5cb"
Unverified Commit 4b822560 authored by Nicholi Caron's avatar Nicholi Caron Committed by GitHub
Browse files

Update mask_generation.md (#31543)

Minor bug fixes -- rearrange import & add missing parentheses
parent 74a20740
......@@ -124,6 +124,7 @@ the processor.
```python
from transformers import SamModel, SamProcessor
import torch
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
......@@ -147,7 +148,6 @@ masks = processor.image_processor.post_process_masks(outputs.pred_masks.cpu(), i
We can visualize the three masks in the `masks` output.
```python
import torch
import matplotlib.pyplot as plt
import numpy as np
......@@ -211,7 +211,7 @@ import matplotlib.patches as patches
fig, ax = plt.subplots()
ax.imshow(image)
rectangle = patches.Rectangle((2350, 1600, 500, 500, linewidth=2, edgecolor='r', facecolor='none')
rectangle = patches.Rectangle((2350, 1600), 500, 500, linewidth=2, edgecolor='r', facecolor='none')
ax.add_patch(rectangle)
ax.axis("off")
plt.show()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment