Commit History
-
Update main.py
Verified signatureed53e61 -
Update README.md
Verified signature13e0c3a -
Update static/index.html
Verified signaturedeecb8f -
Update static/index.html
Verified signature35a00c4 -
Update static/index.html
Verified signature92995c2 -
Create index.html
Verified signatureb59a098 -
Rename static/index.html to static/index1.html
Verified signature7347ecd -
Update README.md
Verified signature732c1a0
-
Update static/index.html
Verified signature4807797 -
Update static/index.html
Verified signature5663e02 -
Update static/index.html
Verified signature8c72911 -
Update main.py
Verified signature215cdaf -
Update main.py
Verified signaturebff39e2 -
Update main.py
Verified signatureae9a263 -
Update main.py
Verified signatureb396701 -
Rename static/static_index (12).html to static/index.html
Verified signature2f99a90 -
Delete static/index.html
Verified signature382da18 -
Upload static_index (12).html
Verified signature55450db -
Rename index.html to static/index.html
Verified signature1140f00 -
Rename static/static_index (12).html to index.html
Verified signature0fb1caa -
Delete static/index.html
Verified signature611a02e -
Upload static_index (12).html
Verified signature13ed926 -
Update static/index.html
Verified signaturee00db0c -
Update main.py
Verified signature2371a34 -
Update main.py
Verified signaturee120bd1 -
Update main.py
Verified signaturef3e6112 -
Update main.py
Verified signature53afd1c -
Update main.py
Verified signature6629a2a -
Update main.py
Verified signature3ea497c -
Update main.py
Verified signature6ebd507 -
Update static/index.html
Verified signature58746b4 -
Update main.py
Verified signature29da619
-
Update static/index.html
Verified signaturecd5b455 -
Update main.py
Verified signaturefrom fastapi import FastAPI, File, UploadFile, HTTPException from fastapi.responses import JSONResponse from gradio_client import Client app = FastAPI() client = Client("https://ashrafb-image-to-sketch.hf.space/") @app.post("/predict") async def predict(file: UploadFile = File(...)): try: # Save the uploaded image to a temporary file with NamedTemporaryFile(delete=False) as tmp: shutil.copyfileobj(file.file, tmp) tmp_path = tmp.name # Call the Gradio client to predict result = client.predict(tmp_path, api_name="/predict") # Delete the temporary file os.unlink(tmp_path) # Parse and return the result sketch_image_url, result_file_url = result return JSONResponse(content={"sketch_image_url": sketch_image_url, "result_file_url": result_file_url}, status_code=200) except Exception as e: raise HTTPException(status_code=500, detail=str(e))d480925 -
Update main.py
Verified signaturefrom fastapi import FastAPI, File, UploadFile from fastapi.responses import StreamingResponse from gradio_client import Client app = FastAPI() client = Client("https://ashrafb-image-to-sketch.hf.space/") @app.post("/predict") async def predict_sketch(file: UploadFile = File(...)): content = await file.read() # Call the Gradio client to get the sketch result result = client.predict(content, api_name="/predict") sketch_image_bytes = result[0].encode('utf-8') # Assuming result[0] is a base64 encoded image return StreamingResponse(io.BytesIO(sketch_image_bytes), media_type="image/png")d571b45 -
Update static/index.html
Verified signature4d1d14d -
Update main.py
Verified signature2c151eb -
Update requirements.txt
Verified signature8f0fb7c -
Update requirements.txt
Verified signature1f784cc -
Rename app.py to main.py
Verified signatureb16696c -
Update Dockerfile
Verified signaturea87831b -
Update Dockerfile
Verified signature1fac76c -
Create model_loader.py
Verified signature4a4cd49 -
Update app.py
Verified signaturee72c238 -
Update app.py
Verified signature05761be -
Update app.py
Verified signature1e19492 -
Rename main.py to app.py
Verified signatured56b8e1 -
Update Dockerfile
Verified signaturea29739c -
Update main.py
Verified signaturec39efdc -
Update main.py
Verified signature277f417