Open Arsey opened 7 years ago
It looks like the function get_labels
in DataUtils.py
does not work as it was designed for and causes the error described above. df.set_index('frame')
does not create groups it just uses frame as index
def get_labels(csv_fname, limit=None, interval=1, start=0, labels=['person', 'bus', 'car']):
df = pd.read_csv(csv_fname)
df = df[df['frame'] >= start]
df = df[df['frame'] < start + limit]
df['frame'] -= start
df = df[df['object_name'].isin(labels)]
groups = df.set_index('frame')
return groups
I'm confused with this part.
It takes all the labels for a given frame and groups it. Pandas is a bit funky, so this allows iteration over a given frame index.
But in this case, it doesn't work
https://github.com/stanford-futuredata/noscope/blob/master/analysis/visualize_yolo.py please try this script instead
When I run Visualizer.py for (jackson-town-square.mp4 + jackson-town-square.csv), the script throws an error:
The code in that place looks strange as you're trying to enumerate the pandas dataframe instead of
df.iterrows()
:As a result in for loop the variable
labels
is a string and is equal to "object_name" and the further iteration over it iterates over the string.pandas version: 0.20.3 python version: 2.7.6