Code Monkey home page Code Monkey logo

Comments (3)

tcapelle avatar tcapelle commented on June 2, 2024

Hey,
This should be pretty straight forward using the DataBlock API. Just define your get_x and get_y, with the corresponding columns in the dataframe. For each row of your dataframe, you get a pair (folder_path, target_value). Something like:

def get_x(row): 
    return Path(row[path_col_name]).ls().sorted()

def get_y(row):
    return row[target_col]

You could also use the fastai method:

Init signature: ColReader(self, cols, pref='', suff='', label_delim=None)
Docstring:      Read `cols` in `row` with potential `pref` and `suff`
File:           ~/miniconda3/envs/fastai/lib/python3.8/site-packages/fastai/data/transforms.py
Type:           _TfmMeta

There is also a more detailed version of the action notebooks on a PR that I am making for fastai :
https://github.com/fastai/fastai/blob/0c18d134099b62dcc9f9b105e2295088f38abab4/nbs/24_tutorial.image_sequence.ipynb

from action_recognition.

rbunn80110 avatar rbunn80110 commented on June 2, 2024

yes, that was it. I was making it way too complicated. Thanks!

from action_recognition.

tcapelle avatar tcapelle commented on June 2, 2024

I the last update, I removed the Block API. Sorry if that hurts your dev.
The mid level API is now the preferred way, and it is very well documented.

from action_recognition.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.