davanstrien HF Staff commited on
Commit
48b2886
Β·
1 Parent(s): cc71572

Refactor output schema to use list for objects and simplify feature definitions

Browse files
Files changed (1) hide show
  1. detect-objects.py +5 -5
detect-objects.py CHANGED
@@ -331,13 +331,13 @@ def main():
331
  # Define output schema before processing
332
  logger.info("πŸ“Š Creating output schema...")
333
  new_features = dataset.features.copy()
334
- new_features["objects"] = Sequence(
335
  {
336
- "bbox": Sequence(Value("float32"), length=4),
337
- "category": ClassLabel(names=[class_name]),
338
- "score": Value("float32"),
339
  }
340
- )
341
 
342
  # Process dataset with explicit output features
343
  logger.info("πŸ” Processing images...")
 
331
  # Define output schema before processing
332
  logger.info("πŸ“Š Creating output schema...")
333
  new_features = dataset.features.copy()
334
+ new_features["objects"] = [
335
  {
336
+ "bbox": [float, float, float, float],
337
+ "category": class_name,
338
+ "score": float,
339
  }
340
+ ]
341
 
342
  # Process dataset with explicit output features
343
  logger.info("πŸ” Processing images...")