MCPcopy Create free account
hub / github.com/ml-explore/mlx-data / ImageRandomCrop

Class ImageRandomCrop

mlx/data/op/ImageTransform.h:70–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68};
69
70class ImageRandomCrop : public ImageTransformOp {
71 public:
72 ImageRandomCrop(
73 const std::string& ikey,
74 int64_t w,
75 int64_t h,
76 const std::string& okey = "");
77 virtual std::shared_ptr<Array> apply_image(
78 const std::shared_ptr<const Array>& image) const override;
79 virtual std::shared_ptr<Array> apply_video(
80 const std::shared_ptr<const Array>& video) const override;
81
82 private:
83 int64_t w_;
84 int64_t h_;
85
86 struct Parameters {
87 int64_t tx;
88 int64_t ty;
89 int64_t tw;
90 int64_t th;
91 };
92
93 Parameters generate_random_crop_(int64_t w, int64_t h) const;
94};
95
96class ImageRandomAreaCrop : public ImageTransformOp {
97 public:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected