| annotation_inside_slice |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
obss/sahi/sahi/slicing.py code served (permissive licence) · get_code("52989f234436027c") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
# SETUP CODE
# Annotation in COCO format with bbox [x, y, width, height]
annotation = {
'bbox': [10, 20, 50, 30] # x=10, y=20, width=50, height=30
}
# Slice bbox in format [x_min, y_min, x_max, y_max]
slice_bbox = [5, 15, 100, 100]
ARGS = {
'annotation': annotation,
'slice_bbox': slice_bbox
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| annotation_inside_slice |
Ran ran on a synthesized input |
Resham-Sundar/sahi-yolox/sahi/slicing.py code served (permissive licence) · get_code("e257047ab1fda46c") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
# Construct annotation in COCO format
# The function accesses annotation['bbox'] which should be [left, top, width, height]
annotation = {
'bbox': [10, 20, 30, 40] # left=10, top=20, width=30, height=40
}
# Construct slice_bbox in format [x_min, y_min, x_max, y_max]
# This should create overlap with the annotation for testing
slice_bbox = [15, 25, 50, 70] # x_min=15, y_min=25, x_max=50, y_max=70
ARGS = {
'annotation': annotation,
'slice_bbox': slice_bbox
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| batched_greedy_nmm |
Ran ran on a synthesized input |
Resham-Sundar/sahi-yolox/sahi/postprocess/combine.py code served (permissive licence) · get_code("b54053e66ee738d8") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# Create a small tensor with bounding boxes, scores, and category IDs
# Shape: [num_boxes, 6] where columns are [x1, y1, x2, y2, score, category_id]
object_predictions_as_tensor = torch.tensor([
[10.0, 10.0, 20.0, 20.0, 0.9, 1.0],
[11.0, 11.0, 21.0, 21.0, 0.8, 1.0],
[50.0, 50.0, 60.0, 60.0, 0.85, 2.0],
[51.0, 51.0, 61.0, 61.0, 0.7, 2.0],
], dtype=torch.float32)
ARGS = {
'object_predictions_as_tensor': object_predictions_as_tensor,
'match_metric': 'IOU',
'match_threshold': 0.5,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| batched_nms |
Ran ran on a synthesized input |
Resham-Sundar/sahi-yolox/sahi/postprocess/combine.py code served (permissive licence) · get_code("8ed0517756dd1b38") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# Create a small predictions tensor with shape [num_boxes, 6]
# Columns: [x1, y1, x2, y2, score, category_id]
predictions = torch.tensor([
[10.0, 10.0, 20.0, 20.0, 0.9, 0.0],
[12.0, 12.0, 22.0, 22.0, 0.8, 0.0],
[50.0, 50.0, 60.0, 60.0, 0.85, 1.0],
[51.0, 51.0, 61.0, 61.0, 0.75, 1.0],
], dtype=torch.float32)
ARGS = {
'predictions': predictions,
'match_metric': 'IOU',
'match_threshold': 0.5,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| calculate_box_union |
Ran ran on a synthesized input |
Resham-Sundar/sahi-yolox/sahi/postprocess/utils.py code served (permissive licence) · get_code("686cde694bfeddb7") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
from typing import List, Union
def calculate_box_union(box1: Union[List[int], np.ndarray], box2: Union[List[int], np.ndarray]) -> List[int]:
"""
Args:
box1 (List[int]): [x1, y1, x2, y2]
box2 (List[int]): [x1, y1, x2, y2]
"""
box1 = np.array(box1)
box2 = np.array(box2)
left_top = np.minimum(box1[:2], box2[:2])
right_bottom = np.maximum(box1[2:], box2[2:])
return list(np.concatenate((left_top, right_bottom)))
ARGS = {
"box1": [10, 20, 50, 80],
"box2": [30, 15, 70, 100]
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| fix_full_shape_list |
Ran ran on a synthesized input |
Resham-Sundar/sahi-yolox/sahi/utils/compatibility.py code served (permissive licence) · get_code("4b5d7326bb4f1646") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
torch.manual_seed(0)
# The function takes one parameter: full_shape_list
# It checks if full_shape_list is not None and if the first element is an int or float
# If so, it wraps the entire list in another list
# Otherwise it returns full_shape_list as-is
# Test case 1: A list of integers/floats (should be wrapped)
full_shape_list_1 = [2, 3, 4, 5]
ARGS = {
"full_shape_list": full_shape_list_1
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 2, dtype family int — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| fix_shift_amount_list |
Ran ran on a synthesized input |
Resham-Sundar/sahi-yolox/sahi/utils/compatibility.py code served (permissive licence) · get_code("abc6663a9ae9fce0") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
torch.manual_seed(0)
# The function fix_shift_amount_list takes a shift_amount_list parameter
# It checks if the first element is an int or float
# If so, it wraps the entire list in another list
# Otherwise it returns the list as-is
# Test case 1: List of numbers (should be wrapped)
shift_amount_list_case1 = [1.5, 2.0, 3.5]
# This will be wrapped into [[1.5, 2.0, 3.5]]
ARGS = {
"shift_amount_list": shift_amount_list_case1
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_ordered_image_name_list |
Ran ran on a synthesized input |
fcakyon/sahi-benchmark/xview/xview_to_coco.py code served (permissive licence) · get_code("d0520a0e6473e8cc") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
from typing import Dict, List
def get_ordered_image_name_list(image_name_to_annotation_ind: Dict):
image_name_list: List[str] = list(image_name_to_annotation_ind.keys())
def get_image_ind(image_name: str):
return int(image_name.split('.')[0])
image_name_list.sort(key=get_image_ind)
return image_name_list
# Create a dictionary where keys are image names (strings with numeric prefixes)
# and values are annotation indices
image_name_to_annotation_ind = {
"001.jpg": 0,
"005.png": 1,
"003.bmp": 2,
"002.gif": 3,
}
ARGS = {
"image_name_to_annotation_ind": image_name_to_annotation_ind,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_slice_bboxes |
Ran ran on a synthesized input |
Resham-Sundar/sahi-yolox/sahi/slicing.py code served (permissive licence) · get_code("0e3c82c0dee22fd7") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
# Define ARGS with valid arguments for get_slice_bboxes
ARGS = {
"image_height": 1024,
"image_width": 1536,
"slice_height": 512,
"slice_width": 512,
"overlap_height_ratio": 0.2,
"overlap_width_ratio": 0.2,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 2, dtype family int — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| merge |
Ran ran on a synthesized input |
Resham-Sundar/sahi-yolox/sahi/utils/coco.py code served (permissive licence) · get_code("4d47f766c74c1466") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import copy
import numpy as np
def create_minimal_coco_dict(num_images=2, num_annotations=3, categories=None):
"""Helper to create a minimal valid COCO dict"""
if categories is None:
categories = [
{'id': 1, 'name': 'car', 'supercategory': 'car'},
{'id': 2, 'name': 'human', 'supercategory': 'human'},
]
images = [
{'id': i, 'file_name': f'image_{i}.jpg', 'height': 480, 'width': 640}
for i in range(1, num_images + 1)
]
annotations = [
{
'id': i,
'image_id': (i % num_images) + 1,
'category_id': (i % len(categories)) + 1,
'area': 100.0,
'bbox': [10, 10, 50, 50],
'iscrowd': 0
}
for i in range(1, num_annotations + 1)
]
return {
'images': images,
'annotations': annotations,
'categories': categories
}
# Create two distinct COCO dicts
coco_dict1 = create_minimal_coco_dict(
num_images=2,
num_annotations=3,
categories=[
{'id': 1, 'name': 'car', 'supercategory': 'car'},
{'id': 2, 'name': 'human', 'supercategory': 'human'},
]
)
coco_dict2 = create_minimal_coco_dict(
num_images=2,
num_annotations=3,
categories=[
{'id': 1, 'name': 'car', 'supercategory': 'car'},
{'id': 2, 'name': 'human', 'supercategory': 'human'},
]
)
# Optional desired_name2id for filtering/reordering
desired_name2id = {
'car': 1,
'human': 2
}
ARGS = {
'coco_dict1': coco_dict1,
'coco_dict2': coco_dict2,
'desired_name2id': desired_name2id
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| merge_from_list |
Ran ran on a synthesized input |
Resham-Sundar/sahi-yolox/sahi/utils/coco.py code served (permissive licence) · get_code("4ab401060d4dd491") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import copy
import numpy as np
# Create sample COCO dictionary 1
coco_dict1 = {
'images': [
{'id': 1, 'file_name': 'img1.jpg', 'height': 480, 'width': 640},
{'id': 2, 'file_name': 'img2.jpg', 'height': 480, 'width': 640},
],
'annotations': [
{'id': 1, 'image_id': 1, 'category_id': 1, 'area': 100, 'bbox': [10, 20, 50, 60], 'iscrowd': 0},
{'id': 2, 'image_id': 1, 'category_id': 2, 'area': 200, 'bbox': [100, 100, 100, 100], 'iscrowd': 0},
{'id': 3, 'image_id': 2, 'category_id': 1, 'area': 150, 'bbox': [30, 40, 60, 70], 'iscrowd': 0},
],
'categories': [
{'id': 1, 'name': 'human', 'supercategory': 'person'},
{'id': 2, 'name': 'car', 'supercategory': 'vehicle'},
]
}
# Create sample COCO dictionary 2
coco_dict2 = {
'images': [
{'id': 1, 'file_name': 'img3.jpg', 'height': 480, 'width': 640},
],
'annotations': [
{'id': 1, 'image_id': 1, 'category_id': 1, 'area': 120, 'bbox': [50, 50, 80, 80], 'iscrowd': 0},
{'id': 2, 'image_id': 1, 'category_id': 3, 'area': 300, 'bbox': [200, 200, 150, 150], 'iscrowd': 0},
],
'categories': [
{'id': 1, 'name': 'human', 'supercategory': 'person'},
{'id': 3, 'name': 'big_vehicle', 'supercategory': 'vehicle'},
]
}
# Create a list of COCO dicts
coco_dict_list = [coco_dict1, coco_dict2]
# Define desired category mapping
desired_name2id = {
'human': 1,
'car': 2,
'big_vehicle': 3,
}
ARGS = {
'coco_dict_list': coco_dict_list,
'desired_name2id': desired_name2id,
'verbose': 1,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| nms |
Ran ran on a synthesized input |
Resham-Sundar/sahi-yolox/sahi/postprocess/combine.py code served (permissive licence) · get_code("272238bc5ffeef61") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# Create a small tensor of predictions with shape [num_boxes, 5]
# Each row: [x1, y1, x2, y2, score]
predictions = torch.tensor([
[10.0, 10.0, 50.0, 50.0, 0.9],
[15.0, 15.0, 55.0, 55.0, 0.8],
[100.0, 100.0, 150.0, 150.0, 0.85]
], dtype=torch.float32)
ARGS = {
'predictions': predictions,
'match_metric': 'IOU',
'match_threshold': 0.5
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| object_prediction_list_to_numpy |
Ran ran on a synthesized input |
Resham-Sundar/sahi-yolox/sahi/postprocess/utils.py code served (permissive licence) · get_code("1c10c8ef13619529") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (2, 6) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
from collections.abc import Sequence
torch.manual_seed(0)
# Define minimal stand-in classes for the object prediction structure
class BBox:
def __init__(self, coords):
self.coords = coords
def to_voc_bbox(self):
return self.coords
class Score:
def __init__(self, value):
self.value = value
class Category:
def __init__(self, id):
self.id = id
class ObjectPrediction:
def __init__(self, bbox, score, category):
self.bbox = bbox
self.score = score
self.category = category
def tolist(self):
return self
# Build a minimal ObjectPredictionList with 2 predictions
bbox1 = BBox([10, 20, 30, 40])
score1 = Score(0.95)
category1 = Category(1)
pred1 = ObjectPrediction(bbox1, score1, category1)
bbox2 = BBox([50, 60, 100, 120])
score2 = Score(0.75)
category2 = Category(2)
pred2 = ObjectPrediction(bbox2, score2, category2)
class ObjectPredictionList(Sequence):
def __init__(self, list):
self.list = list
super().__init__()
def __getitem__(self, i):
if torch.is_tensor(i) or isinstance(i, np.ndarray):
i = i.tolist()
if isinstance(i, int):
return ObjectPredictionList([self.list[i]])
elif isinstance(i, (tuple, list)):
accessed_mapping = map(self.list.__getitem__, i)
return ObjectPredictionList(list(accessed_mapping))
else:
raise NotImplementedError(f'{type(i)}')
def __setitem__(self, i, elem):
if torch.is_tensor(i) or isinstance(i, np.ndarray):
i = i.tolist()
if isinstance(i, int):
self.list[i] = elem
elif isinstance(i, (tuple, list)):
if len(i) != len(elem):
raise ValueError()
if isinstance(elem, ObjectPredictionList):
for ind, el in enumerate(elem.list):
self.list[i[ind]] = el
else:
for ind, el in enumerate(elem):
self.list[i[ind]] = el
else:
raise NotImplementedError(f'{type(i)}')
def __len__(self):
return len(self.list)
def __str__(self):
return str(self.list)
def extend(self, object_prediction_list):
self.list.extend(object_prediction_list.list)
def tolist(self):
if len(self.list) == 1:
return self.list[0]
else:
return self.list
object_prediction_list = ObjectPredictionList([pred1, pred2])
ARGS = {
'object_prediction_list': object_prediction_list
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 2, dtype family float, shape (2, 6) — shape (2, 6) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| object_prediction_list_to_torch |
Ran ran on a synthesized input |
Resham-Sundar/sahi-yolox/sahi/postprocess/utils.py code served (permissive licence) · get_code("2de419bb83449d6e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 6) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
from collections.abc import Sequence
torch.manual_seed(0)
# Stand-in classes for BBox, Score, and Category
class BBox:
def __init__(self, x1, y1, x2, y2):
self.x1 = x1
self.y1 = y1
self.x2 = x2
self.y2 = y2
def to_voc_bbox(self):
return [self.x1, self.y1, self.x2, self.y2]
class Score:
def __init__(self, value):
self.value = value
class Category:
def __init__(self, id):
self.id = id
class ObjectPrediction:
def __init__(self, bbox, score, category):
self.bbox = bbox
self.score = score
self.category = category
def tolist(self):
return self
# Minimal ObjectPredictionList implementation
class ObjectPredictionList(Sequence):
def __init__(self, list):
self.list = list
super().__init__()
def __getitem__(self, i):
if torch.is_tensor(i) or isinstance(i, np.ndarray):
i = i.tolist()
if isinstance(i, int):
return ObjectPredictionList([self.list[i]])
elif isinstance(i, (tuple, list)):
accessed_mapping = map(self.list.__getitem__, i)
return ObjectPredictionList(list(accessed_mapping))
else:
raise NotImplementedError(f'{type(i)}')
def __setitem__(self, i, elem):
if torch.is_tensor(i) or isinstance(i, np.ndarray):
i = i.tolist()
if isinstance(i, int):
self.list[i] = elem
elif isinstance(i, (tuple, list)):
if len(i) != len(elem):
raise ValueError()
if isinstance(elem, ObjectPredictionList):
for ind, el in enumerate(elem.list):
self.list[i[ind]] = el
else:
for ind, el in enumerate(elem):
self.list[i[ind]] = el
else:
raise NotImplementedError(f'{type(i)}')
def __len__(self):
return len(self.list)
def __str__(self):
return str(self.list)
def extend(self, object_prediction_list):
self.list.extend(object_prediction_list.list)
def tolist(self):
if len(self.list) == 1:
return self.list[0]
else:
return self.list
def object_prediction_list_to_torch(object_prediction_list: ObjectPredictionList) -> torch.tensor:
"""
Returns:
torch.tensor of size N x [x1, y1, x2, y2, score, category_id]
"""
num_predictions = len(object_prediction_list)
torch_predictions = torch.zeros([num_predictions, 6], dtype=torch.float32)
for ind, object_prediction in enumerate(object_prediction_list):
torch_predictions[ind, :4] = torch.tensor(object_prediction.tolist().bbox.to_voc_bbox(), dtype=torch.int32)
torch_predictions[ind, 4] = object_prediction.tolist().score.value
torch_predictions[ind, 5] = object_prediction.tolist().category.id
return torch_predictions
# Create sample predictions
pred1 = ObjectPrediction(
bbox=BBox(10, 20, 30, 40),
score=Score(0.95),
category=Category(1)
)
pred2 = ObjectPrediction(
bbox=BBox(50, 60, 70, 80),
score=Score(0.87),
category=Category(2)
)
object_prediction_list = ObjectPredictionList([pred1, pred2])
ARGS = {
"object_prediction_list": object_prediction_list
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float, shape (2, 6) — shape (2, 6) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| read_image |
Ran ran on a synthesized input |
Resham-Sundar/sahi-yolox/sahi/utils/cv.py code served (permissive licence) · get_code("7a2ae5c4bf39dd82") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 3, dtype family int, shape (100, 100, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import cv2
import numpy as np
import tempfile
import os
# Create a temporary directory and a valid test image
temp_dir = tempfile.mkdtemp()
image_path = os.path.join(temp_dir, "test_image.png")
# Create a simple test image (100x100 BGR image)
test_image = np.zeros((100, 100, 3), dtype=np.uint8)
test_image[:, :, 0] = 50 # Blue channel
test_image[:, :, 1] = 100 # Green channel
test_image[:, :, 2] = 150 # Red channel
cv2.imwrite(image_path, test_image)
ARGS = {
"image_path": image_path
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 3, dtype family int, shape (100, 100, 3) — shape (100, 100, 3) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| read_image_as_pil |
Ran ran on a synthesized input |
Resham-Sundar/sahi-yolox/sahi/utils/cv.py code served (permissive licence) · get_code("c8c3e5a8345b053a") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Image. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
from PIL import Image
# Create a test image as a PIL Image
test_image_pil = Image.new('RGB', (100, 100), color='red')
# Create a test numpy array (height, width, channels)
test_image_array = np.random.randint(0, 256, size=(100, 100, 3), dtype=np.uint8)
# Define arguments for read_image_as_pil
ARGS = {
"image": test_image_pil,
"exif_fix": False,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- PIL, numpy, requests, skimage — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| read_large_image |
Ran ran on a synthesized input |
Resham-Sundar/sahi-yolox/sahi/utils/cv.py code served (permissive licence) · get_code("91ba8065c40815aa") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import cv2
import numpy as np
import tempfile
import os
# Create a temporary image file for testing
def create_test_image():
# Create a simple test image (10x10 RGB image)
img_array = np.random.randint(0, 256, (10, 10, 3), dtype=np.uint8)
# Write to a temporary file
with tempfile.NamedTemporaryFile(suffix='.png', delete=False) as tmp:
tmp_path = tmp.name
# Use cv2 to write the image in BGR format
cv2.imwrite(tmp_path, cv2.cvtColor(img_array, cv2.COLOR_RGB2BGR))
return tmp_path
# Create the test image
test_image_path = create_test_image()
ARGS = {
'image_path': test_image_path
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- cv2, numpy, skimage — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| update_categories |
Ran ran on a synthesized input |
Resham-Sundar/sahi-yolox/sahi/utils/coco.py code served (permissive licence) · get_code("ece1ba05d166226f") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import copy
# Construct valid arguments for update_categories function
# desired_name2id: dict mapping category names to desired IDs
desired_name2id = {
"big_vehicle": 1,
"car": 2,
"human": 3
}
# coco_dict: COCO formatted dictionary with images, annotations, and categories
coco_dict = {
'images': [
{'id': 1, 'file_name': 'image1.jpg', 'height': 480, 'width': 640},
{'id': 2, 'file_name': 'image2.jpg', 'height': 480, 'width': 640},
],
'annotations': [
{
'id': 1,
'image_id': 1,
'category_id': 10, # Maps to "big_vehicle" (desired id 1)
'bbox': [10, 10, 100, 100],
'area': 10000,
'iscrowd': 0
},
{
'id': 2,
'image_id': 1,
'category_id': 11, # Maps to "car" (desired id 2)
'bbox': [150, 150, 80, 80],
'area': 6400,
'iscrowd': 0
},
{
'id': 3,
'image_id': 2,
'category_id': 12, # Maps to "human" (desired id 3)
'bbox': [200, 200, 50, 100],
'area': 5000,
'iscrowd': 0
},
{
'id': 4,
'image_id': 2,
'category_id': 99, # Not in desired_name2id, should be filtered out
'bbox': [300, 300, 40, 40],
'area': 1600,
'iscrowd': 0
},
],
'categories': [
{'id': 10, 'name': 'big_vehicle', 'supercategory': 'vehicle'},
{'id': 11, 'name': 'car', 'supercategory': 'vehicle'},
{'id': 12, 'name': 'human', 'supercategory': 'person'},
{'id': 99, 'name': 'other', 'supercategory': 'other'},
]
}
ARGS = {
'desired_name2id': desired_name2id,
'coco_dict': coco_dict
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_slice_bboxes |
Not yet run unverified (harvested, no recorded run) |
obss/sahi/sahi/slicing.py code served (permissive licence) · get_code("7fc4f6b132018cc2") How it ran |