Skip to content

Instantly share code, notes, and snippets.

@Chuttyboy
Created April 14, 2022 09:30
Show Gist options
  • Select an option

  • Save Chuttyboy/f9835d43d6e336b7f078f3267d0d35a3 to your computer and use it in GitHub Desktop.

Select an option

Save Chuttyboy/f9835d43d6e336b7f078f3267d0d35a3 to your computer and use it in GitHub Desktop.
Give priority status to Human activity detection objects ( color coding )
with open('output_test.txt','r') as file:
data = file.readlines()
for a in range(len(data)):
if 'person' in data[a] and 'tv' in data[a]:
data[a] = data[a].replace('\n','') + ' status : Low\n'
else:
data[a] = data[a] + ' status : High\n'
with open('outputs.txt','w') as file:
file.writelines(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment