You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the LandmarkDataset class from the landmarker package with store_imgs=False and providing in-memory images (not file paths) via imgs = [image], an unexpected AttributeError is raised:
AttributeError: 'LandmarkDataset' object has no attribute 'image_loader'
This is a bug — the dataset is expected to support store_imgs=False regardless of whether the input images are in-memory objects or file paths. The attribute image_loader is not defined anywhere in the code, making the source of this error unclear and unexpected.
Steps to Reproduce:
Set imgs = [image] where image is a loaded image (e.g., a PIL or NumPy object), not a file path
Initialize the dataset:
ds=LandmarkDataset(imgs=imgs, store_imgs=False)
Use the dataset (e.g., iterate through it or index an item)
Observe the error:
AttributeError: 'LandmarkDataset' object has no attribute 'image_loader'
Expected Behavior:
The dataset should support in-memory images with store_imgs=False and operate without errors.
Actual Behavior:
An AttributeError is thrown due to a missing image_loader attribute that is never explicitly defined or initialized.
Suggested Fix:
Ensure that LandmarkDataset handles in-memory images properly when store_imgs=False, and avoid referencing or relying on an undefined image_loader attribute. If image_loader is intended to be used internally, it should be properly initialized or the logic should be revised to avoid such dependency in this configuration.
The text was updated successfully, but these errors were encountered:
Description:
When using the
LandmarkDataset
class from thelandmarker
package withstore_imgs=False
and providing in-memory images (not file paths) viaimgs = [image]
, an unexpectedAttributeError
is raised:This is a bug — the dataset is expected to support
store_imgs=False
regardless of whether the input images are in-memory objects or file paths. The attributeimage_loader
is not defined anywhere in the code, making the source of this error unclear and unexpected.Steps to Reproduce:
Set
imgs = [image]
whereimage
is a loaded image (e.g., a PIL or NumPy object), not a file pathInitialize the dataset:
Use the dataset (e.g., iterate through it or index an item)
Observe the error:
Expected Behavior:
The dataset should support in-memory images with
store_imgs=False
and operate without errors.Actual Behavior:
An
AttributeError
is thrown due to a missingimage_loader
attribute that is never explicitly defined or initialized.Suggested Fix:
Ensure that
LandmarkDataset
handles in-memory images properly whenstore_imgs=False
, and avoid referencing or relying on an undefinedimage_loader
attribute. Ifimage_loader
is intended to be used internally, it should be properly initialized or the logic should be revised to avoid such dependency in this configuration.The text was updated successfully, but these errors were encountered: