You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
490B

  1. import logging
  2. import os
  3. import torch
  4. logger = logging.getLogger(__name__)
  5. logging.basicConfig(
  6. format="%(asctime)s - %(levelname)s - %(name)s - %(message)s",
  7. datefmt="%m/%d/%Y %H:%M:%S",
  8. level=os.environ.get("LOGLEVEL", "INFO").upper(),
  9. )
  10. def get_pinjie(img, shift):
  11. nbox = img.shape[1]
  12. shift = torch.from_numpy(shift).to(img.device)
  13. shift = shift.unsqueeze(1).repeat(1, nbox, 1)
  14. img[..., :2] += shift
  15. img_out = img.view(1, -1, 7)
  16. return img_out