-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP, would need more work but short on time
[x] initial refactor [x] adding a barebones filesystem dataloader [x] barebones unit test -> broken [ ] benchmark on IN1k
- Loading branch information
1 parent
dd80544
commit d2ab48c
Showing
19 changed files
with
472 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,16 +38,17 @@ jobs: | |
- name: Build python module | ||
run: | | ||
cd src/pkg/client | ||
cd src/pkg | ||
gopy pkg -author="Photoroom" -email="[email protected]" -name="datago" . | ||
export DESTINATION="../../../build" | ||
export DESTINATION="../../build" | ||
mkdir -p $DESTINATION/datago | ||
mv datago/* $DESTINATION/datago/. | ||
mv setup.py $DESTINATION/. | ||
mv Makefile $DESTINATION/. | ||
mv README.md $DESTINATION/. | ||
rm LICENSE MANIFEST.in | ||
cd ../../../build | ||
ls ../.. | ||
cd ../../build | ||
- name: Install python module | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,7 +107,7 @@ NOTE: | |
- - Either `export PATH=$PATH:~/go/bin` or add it to your .bashrc | ||
- you may need this to make sure that LDD looks at the current folder `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.` | ||
|
||
then from the /pkg/client folder: | ||
then from the /pkg folder: | ||
|
||
```bash | ||
$ gopy pkg -author="Photoroom" -email="[email protected]" -url="" -name="datago" -version="0.0.1" . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ DESTINATION="../../../python_$python_version" | |
rm -rf $DESTINATION | ||
|
||
# Build the python package via the gopy toolchain | ||
cd src/pkg/client | ||
cd src/pkg | ||
gopy pkg -author="Photoroom" -email="[email protected]" -url="" -name="datago" -version="0.3" . | ||
mkdir -p $DESTINATION/datago | ||
mv datago/* $DESTINATION/datago/. | ||
|
@@ -21,6 +21,6 @@ mv README.md $DESTINATION/. | |
rm LICENSE | ||
rm MANIFEST.in | ||
|
||
cd ../../.. | ||
cd ../.. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pytest | ||
pytest | ||
pillow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package datago | ||
|
||
import "context" | ||
|
||
// --- Sample data structures - these will be exposed to the Python world --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
type LatentPayload struct { | ||
Data []byte | ||
Len int | ||
DataPtr uintptr | ||
} | ||
|
||
type ImagePayload struct { | ||
Data []byte | ||
OriginalHeight int // Good indicator of the image frequency dbResponse at the current resolution | ||
OriginalWidth int | ||
Height int // Useful to decode the current payload | ||
Width int | ||
Channels int | ||
DataPtr uintptr | ||
} | ||
|
||
type Sample struct { | ||
ID string | ||
Source string | ||
Attributes map[string]interface{} | ||
Image ImagePayload | ||
Masks map[string]ImagePayload | ||
AdditionalImages map[string]ImagePayload | ||
Latents map[string]LatentPayload | ||
CocaEmbedding []float32 | ||
Tags []string | ||
} | ||
|
||
// --- Generator and Backend interfaces --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
|
||
// The generator will be responsible for producing pages of metadata which can be dispatched | ||
// to the dispatch goroutine. The metadata will be used to fetch the actual payloads | ||
|
||
type SampleDataPointers interface{} | ||
|
||
type Pages struct { | ||
samplesDataPointers []SampleDataPointers | ||
} | ||
|
||
type Generator interface { | ||
generatePages(ctx context.Context, chanPages chan Pages) | ||
} | ||
|
||
// The backend will be responsible for fetching the payloads and deserializing them | ||
type Backend interface { | ||
collectSamples(chanSampleMetadata chan SampleDataPointers, chanSamples chan Sample, transform *ARAwareTransform, pre_encode_images bool) | ||
} |
Oops, something went wrong.