Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Error in Classify Image

Abierto
#22 0 comentarios 0 reacciones 2 asignados Ver en GitHub

@john-matroid ya está trabajando en esto.

Desde el 28/3/2025.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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'
Lenguaje dominante
Python
Estrellas
18
Forks
5
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de matroid/matroid-python

Todos los issues de matroid/matroid-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.