Skip to main content
added 119 characters in body
Source Link
Tlaloc-ES
  • 5.2k
  • 10
  • 53
  • 104

You can do that with:

import torch

device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
path = '/path/to/your/file.pt'
model = torch.hub.load("WongKinYiu/yolov7","custom",f"{path}",trust_repo=True)

To get results you can run

results = model("/path/to/your/photo")

To get bbox you can use:

results.pandas().xyxy

EDIT

I created a repository with a python package in order to this easily

https://github.com/Tlaloc-Es/aipose

You can do that with:

import torch

device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
path = '/path/to/your/file.pt'
model = torch.hub.load("WongKinYiu/yolov7","custom",f"{path}",trust_repo=True)

To get results you can run

results = model("/path/to/your/photo")

To get bbox you can use:

results.pandas().xyxy

You can do that with:

import torch

device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
path = '/path/to/your/file.pt'
model = torch.hub.load("WongKinYiu/yolov7","custom",f"{path}",trust_repo=True)

To get results you can run

results = model("/path/to/your/photo")

To get bbox you can use:

results.pandas().xyxy

EDIT

I created a repository with a python package in order to this easily

https://github.com/Tlaloc-Es/aipose

Source Link
Tlaloc-ES
  • 5.2k
  • 10
  • 53
  • 104

You can do that with:

import torch

device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
path = '/path/to/your/file.pt'
model = torch.hub.load("WongKinYiu/yolov7","custom",f"{path}",trust_repo=True)

To get results you can run

results = model("/path/to/your/photo")

To get bbox you can use:

results.pandas().xyxy