What package and version are you using ? Amiga OS 2.0
Please, describe the issues you are seeing ? Are there any existing scripts that can extract images/metadata from the .bin files saved using the Recorder_v2 application?
** Any possible information will make the live of the community members easy to reply and provide a solution.
The use of our scripts and examples for interacting with the pre-release Amiga OS 2.0 is not yet well documented (but is soon to come as we roll out the release!).
We have a good example for what you want to do. It’s not yet merged into GitHub - farm-ng/farm-ng-amiga at main-v2 (the farm-ng-amiga branch that corresponds to AmigaOS v2.x), so it would’ve been hard for you to find this.
To get started on the extraction of images, you can try the file_reader example that will playback your log and show the stream for a given camera stream in a cv2 window:
Then look at the file_converter example that can convert your log either to an mp4 file or a series of jpg images for a given camera stream.
Both files have accompanying README files.
For the metadata, this depends on what you are looking for. Assuming you mean camera calibration parameters, then you can filter the events_dict in the examples for the f"/{camera_name}/calibration" topic name.
Please let me know if you have any additional questions.
–Kyle
Traceback (most recent call last):
File “/Users/earlranario/Documents/GEMINI/scripts/bin-to-images/test/convert_binary.py”, line 161, in
main(args.file_name, args.output_path, args.camera_name, args.view_name, args.disparity_scale, args.video_to_jpg)
File “/Users/earlranario/Documents/GEMINI/scripts/bin-to-images/test/convert_binary.py”, line 97, in main
sample: oak_pb2.OakFrame = event_log.read_message()
File “/Users/earlranario/miniconda3/envs/amiga/lib/python3.9/site-packages/farm_ng/core/events_file_reader.py”, line 48, in read_message
return self.reader.read_message(self)
File “/Users/earlranario/miniconda3/envs/amiga/lib/python3.9/site-packages/farm_ng/core/events_file_reader.py”, line 163, in read_message
name, package = parse_protobuf_descriptor(event_log.event.uri)
File “/Users/earlranario/miniconda3/envs/amiga/lib/python3.9/site-packages/farm_ng/core/events_file_reader.py”, line 27, in parse_protobuf_descriptor
type_split, pb_split = uri.query.split(“&”)
ValueError: too many values to unpack (expected 2)
Debugging into this line, I found 3 values rather than 2:
I’m assuming I would need to install from source to install these packages on these branches?
It seems to fail when I do (using setup.py). I cloned the repository and then changed branches.
For farm-ng-amiga:
Preparing metadata (pyproject.toml) did not run successfully.
For farm-ng-core:
Building wheel for farm-ng-core (pyproject.toml) did not run successfully.
Do you recommend any other way to install them?
Side note: I was able to successfully extract the images but I also am interested in timestamps and gps information from the exported binary file.
You should be able to install farm-ng-core & farm-ng-amiga in editable mode in the following way:
# Clone the repos
git clone https://github.com/farm-ng/farm-ng-core.git
git clone https://github.com/farm-ng/farm-ng-amiga.git
# Checkout correct branches and update
cd farm-ng-core/
git checkout main
git pull
git submodule update --init --recursive
cd ../
cd farm-ng-amiga/
git checkout main-v2
git pull
cd ../
# Create and source a virtual environment
python3 -m venv venv
source venv/bin/activate
# Upgrade some deps
pip install --upgrade pip
pip install --upgrade setuptools wheel
# Install the packages
pip install -e farm-ng-core
pip install --no-build-isolation -e farm-ng-amiga
Now you should see both installed if you check with pip list. For any of the examples, there should be some basic requirements (e.g. numpy & opencv-python) in a requirements.txt file nested in the corresponding example folder. Install these in your virtual environment with e.g.,
cd farm-ng-amiga/py/examples/camera_client/
pip install -r requirements.txt
If you wouldn’t mind spinning each of these off into separate discourse posts (one per topic), it will help future users find the answers more easily. I’ll be happy to respond there.
@kylecoble thanks Kyle, git submodule update --init --recursive ran with no error but a new error occurred when running pip install -e farm-ng-core
Building editable for farm-ng-core (pyproject.toml) did not run successfully.
…
error: command ‘/usr/local/opt/llvm/bin/clang’ failed with exit code 1
clang-15: error: unknown argument: ‘-fconcepts’
[end of output]
That is surprising, but thank you for working through this with us. Can you give me some more information on your system, including your OS, python3 version, & clang version?
You can check clang with clang --version.
If you do not have clang installed, you can run:
sudo apt update
sudo apt install clang
From your venv, you can check with python --version.
Unfortunately the python build for our new APIs has been broken for MacOS. Let me work on fixing this and I will update you very soon with new instructions or the green light to pull the latest and try the previous commands.
Since you are unblocked, for now we will maintain Ubuntu 20.04 + python 3.8 as the only supported version combination for running the examples. Also FYI - we are actively working on expanding the set of examples, so be sure to check back regularly.