Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug on Windows when saving an output img. #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cam_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def arg_parse():

img, orig_im, dim = prep_image(frame, inp_dim)

# im_dim = torch.FloatTensor(dim).repeat(1,2)
im_dim = torch.FloatTensor(dim).repeat(1,2)


if CUDA:
Expand Down
9 changes: 7 additions & 2 deletions detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import random
import pickle as pkl
import itertools
import platform


class test_net(nn.Module):
def __init__(self, num_layers, input_size):
Expand Down Expand Up @@ -298,8 +300,11 @@ def write(x, batches, results):


list(map(lambda x: write(x, im_batches, orig_ims), output))

det_names = pd.Series(imlist).apply(lambda x: "{}/det_{}".format(args.det,x.split("/")[-1]))

if platform.system() == 'Windows':
det_names = pd.Series(imlist).apply(lambda x: "{}\\det_{}".format(args.det,x.split("\\")[-1]))
else:
det_names = pd.Series(imlist).apply(lambda x: "{}/det_{}".format(args.det,x.split("/")[-1]))

list(map(cv2.imwrite, det_names, orig_ims))

Expand Down