Error in Classify Image
@john-matroid đang làm issue này rồi.
Từ ngày 28/3/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
When running the following code:
import json
import os
from matroid.client import Matroid
api = Matroid(client_id='XXX', client_secret='XXX')
folder = "/Users/alex/Downloads/frames"
files = [os.path.join(folder, f) for f in os.listdir(folder)]
# Process files in batches of 5
batch_size = 5
results = []
for i in range(0, len(files), batch_size):
batch = files[i:i + batch_size]
batch_result = api.classify_image(detectorId='67ca12fa78705347cded7b1e', file=batch)
results.extend(batch_result)
with open("results.json", "w") as f:
json.dump(results, f, indent=4)
I had this error:
Traceback (most recent call last):
File "/Users/alex/temp1/temp/lib/python3.13/site-packages/matroid/src/images.py", line 36, in classify_image
return batch_file_request(file, method, endpoint, headers, data)
File "/Users/alex/temp1/temp/lib/python3.13/site-packages/matroid/src/helpers.py", line 116, in batch_file_request
% (bytes_to_mb(MAX_LOCAL_IMAGE_BATCH_SIZE))
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: bytes_to_mb() missing 1 required positional argument: 'bytes'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/alex/temp1/get_annotations.py", line 15, in <module>
batch_result = api.classify_image(detectorId='67ca12fa78705347cded7b1e', file=batch)
File "/Users/alex/temp1/temp/lib/python3.13/site-packages/matroid/src/helpers.py", line 18, in setup_and_teardown
response = func(self, *original_args, **original_kwargs)
File "/Users/alex/temp1/temp/lib/python3.13/site-packages/matroid/src/images.py", line 46, in classify_image
raise error.APIConnectionError(message=e)
matroid.error.APIConnectionError: bytes_to_mb() missing 1 required positional argument: 'bytes'
- Ngôn ngữ chính
- Python
- Star
- 18
- Fork
- 5
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của matroid/matroid-python
-
Sample Stream Endpoint Missing Đang mởbug
matroid/matroid-python#20 · 1 bình luận · 1 người được giao ·
Tất cả issue của matroid/matroid-python
Issue tương tự
-
bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
open-webui/open-webui#30750 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100