deepstylelib

package
v0.0.0-...-487ff99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2016 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateNotReadyToProcess    = "NOT_READY_TO_PROCESS"  // no attachments yet
	StateReadyToProcess       = "READY_TO_PROCESS"      // attachments added
	StateBeingProcessed       = "BEING_PROCESSED"       // worker running
	StateProcessingSuccessful = "PROCESSING_SUCCESSFUL" // worker done
	StateProcessingFailed     = "PROCESSING_FAILED"     // processing failed
)

Job States

View Source
const (
	SourceImageAttachment = "source_image"
	StyleImageAttachment  = "style_image"
	ResultImageAttachment = "result_image"
)
View Source
const (
	DesignDocName = "unprocessed_jobs"
	ViewName      = "unprocessed_jobs"
)
View Source
const (
	Job = "job"
)

Doc types

Variables

This section is empty.

Functions

func AddCloudWatchMetrics

func AddCloudWatchMetrics(syncGwAdminUrl string) error

func GetDbConnection

func GetDbConnection(syncGatewayUrl string) (db couch.Database, err error)

Types

type Attachments

type Attachments map[string]interface{}

type ChangesFeedFollower

type ChangesFeedFollower struct {
	Database          couch.Database
	UniqushURL        string
	ProcessJobs       bool // Run NeuralStyle (typically only on AWS+GPU)
	SendNotifications bool // Send push notifications when jobs done
	StartingSince     string
}

func NewChangesFeedFollower

func NewChangesFeedFollower(startingSince, syncGatewayUrl string) (*ChangesFeedFollower, error)

func (ChangesFeedFollower) Follow

func (f ChangesFeedFollower) Follow()

type DeepStyleJob

type DeepStyleJob struct {
	// contains filtered or unexported fields
}

func NewDeepStyleJob

func NewDeepStyleJob(jobDoc JobDocument, config configuration) *DeepStyleJob

func (DeepStyleJob) DownloadAttachments

func (d DeepStyleJob) DownloadAttachments() (err error, sourceImagePath, styleImagePath string)

func (DeepStyleJob) Execute

func (d DeepStyleJob) Execute() (err error, outputFilePath, stdOutAndErr string)

type Document

type Document struct {
	Revision string `json:"_rev"`
	Id       string `json:"_id"`
}

type JobDocument

type JobDocument struct {
	TypedDocument
	Attachments      Attachments `json:"_attachments"`
	State            string      `json:"state"`
	CreatedAt        string      `json:"created_at"`
	Owner            string      `json:"owner"`
	OwnerDeviceToken string      `json:"owner_devicetoken"`
	ErrorMessage     string      `json:"error_message"`
	StdOutAndErr     string      `json:"std_out_and_err"`
	// contains filtered or unexported fields
}

func NewJobDocument

func NewJobDocument(documentId string, config configuration) (jobDocument *JobDocument, err error)

func (*JobDocument) AddAttachment

func (doc *JobDocument) AddAttachment(attachmentName, filepath string) (err error)

func (JobDocument) IsProcessingFailed

func (doc JobDocument) IsProcessingFailed() bool

func (JobDocument) IsProcessingSuccessful

func (doc JobDocument) IsProcessingSuccessful() bool

func (JobDocument) IsReadyToProcess

func (doc JobDocument) IsReadyToProcess() bool

func (*JobDocument) RefreshFromDB

func (doc *JobDocument) RefreshFromDB() error

func (*JobDocument) RetrieveAttachment

func (doc *JobDocument) RetrieveAttachment(attachmentName string) (io.Reader, error)

func (*JobDocument) SetConfiguration

func (doc *JobDocument) SetConfiguration(config configuration)

func (*JobDocument) SetErrorMessage

func (doc *JobDocument) SetErrorMessage(errorMessage error) (updated bool, err error)

func (*JobDocument) SetStdOutAndErr

func (doc *JobDocument) SetStdOutAndErr(stdOutAndErr string) (updated bool, err error)

func (*JobDocument) UpdateState

func (doc *JobDocument) UpdateState(newState string) (updated bool, err error)

type TrackedDeepStyleJob

type TrackedDeepStyleJob struct {
	// contains filtered or unexported fields
}

Adds a time when we first saw this job in it's current state so that we can detect "stuck" jobs that never get processed.

type TypedDocument

type TypedDocument struct {
	Document
	Type string `json:"type"`
}

func (TypedDocument) IsJob

func (doc TypedDocument) IsJob() bool

type ViewParams

type ViewParams struct {
	JobDocType string
	JobState1  string
	JobState2  string
	JobState3  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL