Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ojh6404 committed Jan 14, 2024
1 parent 9978fcc commit dc88f6b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions node_scripts/deva_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,14 @@ def callback(self, img_msg):
self.image = self.bridge.imgmsg_to_cv2(img_msg, desired_encoding="rgb8")
with torch.cuda.amp.autocast(enabled=self.cfg["amp"]):
h, w = self.image.shape[:2]
deva_input = im_normalization(torch.from_numpy(self.image).permute(2, 0, 1).float() / 255).unsqueeze(0).to(self.deva_config.device)
deva_input = F.interpolate(deva_input, (h, w), mode='bilinear', align_corners=False)[0]
deva_input = F.interpolate(
im_normalization(torch.from_numpy(self.image).permute(2, 0, 1).float() / 255)
.unsqueeze(0)
.to(self.deva_config.device),
(h, w),
mode="bilinear",
align_corners=False,
)[0]
if self.cnt % self.cfg["detection_every"] == 0:
incorporate_mask, segments_info = segment_with_text(
self.cfg,
Expand Down

0 comments on commit dc88f6b

Please sign in to comment.