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

'Tensor' object cannot be interpreted as an integer #74

Open
Maiotekiot opened this issue Mar 18, 2024 · 0 comments
Open

'Tensor' object cannot be interpreted as an integer #74

Maiotekiot opened this issue Mar 18, 2024 · 0 comments

Comments

@Maiotekiot
Copy link

class_names = [c.strip() for c in open("models/classes.TXT").readlines()]
boxes, scores, classes, nums = yolo(img)
count=0
for i in range(nums[0]): >>>>>>>> ERROR LINE
if int(classes[0][i] == 0):
count +=1
if int(classes[0][i] == 67):
print('Mobile Phone detected')
if count == 0:
print('No person detected')
elif count > 1:
print('More than one person detected')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant