scanner-research / scanner

Efficient video analysis at scale
https://scanner-research.github.io/
Apache License 2.0
620 stars 108 forks source link

scanner Quickstart example error #262

Closed ktaggart closed 5 years ago

ktaggart commented 5 years ago

I am attempting to run the Quickstart from the getting started section of scanner.run. When I execute the main.py script, I get the following error:

TypeError: [640] has type list, but expected one of: int, long

Here are my steps:

$ docker-compose run --service-ports cpu /bin/bash root@722e2ebc469a:/opt/scanner# cd examples/apps/quickstart root@722e2ebc469a:/opt/scanner/examples/apps/quickstart# wget https://storage.googleapis.com/scanner-data/public/sample-clip.mp4 --2019-03-21 17:55:37-- https://storage.googleapis.com/scanner-data/public/sample-clip.mp4 Resolving storage.googleapis.com (storage.googleapis.com)... 216.58.195.80, 2607:f8b0:400a:803::2010 Connecting to storage.googleapis.com (storage.googleapis.com)|216.58.195.80|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 15289800 (15M) [video/mp4] Saving to: ‘sample-clip.mp4’

sample-clip.mp4 100%[===================================================================================================================>] 14.58M 2.78MB/s in 5.5s

2019-03-21 17:55:44 (2.67 MB/s) - ‘sample-clip.mp4’ saved [15289800/15289800]

root@722e2ebc469a:/opt/scanner/examples/apps/quickstart# python3 main.py Your Scanner configuration file (/root/.scanner/config.toml) does not exist. Create one? [Y/n] Wrote Scanner configuration to /root/.scanner/config.toml Traceback (most recent call last): File "main.py", line 28, in main() File "main.py", line 21, in main sc.run(output, PerfParams.estimate()) File "/usr/local/lib/python3.5/dist-packages/scannerpy/client.py", line 1371, in run job_params.ops.extend([e.to_proto(op_index) for e in sorted_ops]) File "/usr/local/lib/python3.5/dist-packages/scannerpy/client.py", line 1371, in job_params.ops.extend([e.to_proto(op_index) for e in sorted_ops]) File "/usr/local/lib/python3.5/dist-packages/scannerpy/op.py", line 301, in to_proto e.kernel_args = python_to_proto(proto_name, self._args) File "/usr/local/lib/python3.5/dist-packages/scannerpy/protobufs.py", line 141, in python_to_proto return create_obj(args_proto, p, obj).SerializeToString() File "/usr/local/lib/python3.5/dist-packages/scannerpy/protobufs.py", line 137, in create_obj setattr(proto_obj, k, make_field(v)) TypeError: [640] has type list, but expected one of: int, long root@722e2ebc469a:/opt/scanner/examples/apps/quickstart#

ktaggart commented 5 years ago

The solution was to remove the square brackets from the height and width values:

resized = sc.ops.Resize(frame=sampled_frame, width=[640], height=[480]) # Resize input frame

To:

resized = sc.ops.Resize(frame=sampled_frame, width=640, height=480) # Resize input frame

willcrichton commented 5 years ago

Thanks for the issue. We're going to be issuing a new release of Scanner with updated docs/tutorials in the next week (see #255) so a lot of these problem will be fixed soon.