I am a beginner with the Python. I am trying to run the following code to replace some labels in .txt annotation files.
import os
for txt_in in os.listdir(r"uncorrected-YOLO_darknet"):
with open(txt_in) as infile:
for line in infile:
word=line.split(" ")[0]
if word="6":
word.replace('6', '5')
elif word="9":
word.replace('9', '6')
elif word="10":
word.replace('10', '7')
elif word="11":
word.replace('11', '8')
else:
continue
break
but I am getting the following error:
File "<tokenize>", line 7
if word="6":
^
IndentationError: unindent does not match any outer indentation level
I tried to find the indentation error but it looked alright to me. Plz help. tnx!