ml-explore / mlx

MLX: An array framework for Apple silicon
https://ml-explore.github.io/mlx/
MIT License
17.18k stars 993 forks source link

Using Yolov8 and Anomalib with MLX #407

Open AhmedHamadto opened 10 months ago

AhmedHamadto commented 10 months ago

I am currently working on computer vision and anomaly detection projects and was wondering how would I use yolov8 and anomalib with the MLX framework?

The plan is to use Mac Minis as edge computers to handle all of the image processing.

I'd like to add I am new to using github issues and hope this is the right place and right way to ask my question.

Any and all guidance is appreciated.

Thank you in advance.

menzHSE commented 10 months ago

I guess you cannot use both at the moment with MLX. You would need to re-implement / port the models you need over to MLX.

NeptuneIsTheBest commented 10 months ago

@AhmedHamadto Maybe you can wait until those pooling layers are released before implementing your version of yolov8 on MLX. :>

AhmedHamadto commented 10 months ago

@NeptuneIsTheBest so basically once they release the layers you're suggesting I rebuild yolov8 from the ground up on MLX? Sounds interesting.

bertinma commented 10 months ago

Hi, I'm trying to implement yolov5 with MLX.

So, I already made some blocks as : ConvBlock, C3f, Bottleneck and SPPF (their names in ultralytics repo). But yes, MaxPooling is not implemented and I'm facing the same issue so I will code it using Python (I don't have C++ knwoledge to implement it).

Let me know If you want to collaborate on this ;)

menzHSE commented 10 months ago

For MaxPooling, also have a look at https://github.com/robertmccraith/mimm/blob/main/mimm/layers/max_pool.py

AhmedHamadto commented 10 months ago

@bertinma I would be quite interested in that, I have a few colleagues whom have also expressed interest, I think a collaboration on this would be genuinely fruitful.

I have created a discord server for this project, this is the invite link: https://discord.gg/XBUP5kVC

AhmedHamadto commented 10 months ago

Professor @menzHSE , if you're interested in joining us it would be an honour and pleasure to have you onboard.

menzHSE commented 10 months ago

I have to pass on that, sorry. But I will follow your progress and am happy to try out and test your implementation.

NeptuneIsTheBest commented 10 months ago

@NeptuneIsTheBest so basically once they release the layers you're suggesting I rebuild yolov8 from the ground up on MLX? Sounds interesting.

@AhmedHamadto Hello, because I think this can reduce duplication of work. You don't need to make your code change frequently and just focus on high-level implementation. If I can help you, I hope to join you (because I also want to implement the MLX version of yolov7). It would be a great honor for me to be a part of your project. :>

AhmedHamadto commented 10 months ago

@NeptuneIsTheBest Welcome aboard! The more the merrier, please do feel free to join the discord channel via the above invite link! Happy to have you with us 😄